Browse Source

Add contribmap app with model on existing data

Using ./manage.py inspectdb
Jocelyn Delande 9 years ago
parent
commit
4c5ca2dd11

+ 0 - 0
wifiwithme/apps/contribmap/__init__.py


+ 3 - 0
wifiwithme/apps/contribmap/admin.py

@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.

+ 7 - 0
wifiwithme/apps/contribmap/apps.py

@@ -0,0 +1,7 @@
+from __future__ import unicode_literals
+
+from django.apps import AppConfig
+
+
+class ContribmapConfig(AppConfig):
+    name = 'contribmap'

+ 0 - 0
wifiwithme/apps/contribmap/migrations/__init__.py


+ 40 - 0
wifiwithme/apps/contribmap/models.py

@@ -0,0 +1,40 @@
+# This is an auto-generated Django model module.
+# You'll have to do the following manually to clean this up:
+#   * Rearrange models' order
+#   * Make sure each model has one field with primary_key=True
+#   * Make sure each ForeignKey has `on_delete` set to the desired behavior.
+#   * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
+# Feel free to rename the models, but don't rename db_table values or field names.
+from __future__ import unicode_literals
+
+from django.db import models
+
+
+class Contrib(models.Model):
+    id = models.AutoField(primary_key=True, blank=True, null=True)
+    name = models.TextField(blank=True, null=True)
+    contrib_type = models.TextField(blank=True, null=True)
+    latitude = models.FloatField(blank=True, null=True)
+    longitude = models.FloatField(blank=True, null=True)
+    phone = models.TextField(blank=True, null=True)
+    email = models.TextField(blank=True, null=True)
+    access_type = models.TextField(blank=True, null=True)
+    connect_local = models.IntegerField(blank=True, null=True)
+    connect_internet = models.IntegerField(blank=True, null=True)
+    bandwidth = models.FloatField(blank=True, null=True)
+    share_part = models.FloatField(blank=True, null=True)
+    floor = models.IntegerField(blank=True, null=True)
+    floor_total = models.IntegerField(blank=True, null=True)
+    orientations = models.TextField(blank=True, null=True)
+    roof = models.IntegerField(blank=True, null=True)
+    comment = models.TextField(blank=True, null=True)
+    privacy_name = models.IntegerField(blank=True, null=True)
+    privacy_email = models.IntegerField(blank=True, null=True)
+    privacy_coordinates = models.IntegerField(blank=True, null=True)
+    privacy_place_details = models.IntegerField(blank=True, null=True)
+    privacy_comment = models.IntegerField(blank=True, null=True)
+    date = models.TextField(blank=True, null=True)
+
+    class Meta:
+        managed = False
+        db_table = 'contribs'

+ 3 - 0
wifiwithme/apps/contribmap/tests.py

@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.

+ 3 - 0
wifiwithme/apps/contribmap/views.py

@@ -0,0 +1,3 @@
+from django.shortcuts import render
+
+# Create your views here.

+ 2 - 2
wifiwithme/settings/base.py

@@ -16,7 +16,6 @@ import sys
 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 
-
 # Quick-start development settings - unsuitable for production
 # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
 
@@ -38,6 +37,7 @@ INSTALLED_APPS = [
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
+    'contribmap',
 ]
 
 MIDDLEWARE_CLASSES = [
@@ -78,7 +78,7 @@ WSGI_APPLICATION = 'wifiwithme.wsgi.application'
 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+        'NAME': os.path.join(os.path.dirname(BASE_DIR), 'db.sqlite3'),
     }
 }