From d4824f44a7721e27ff72b71e63e1b7da28054047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Felipe=20Esguerra=20Restrepo?= Date: Thu, 9 Apr 2015 15:09:51 -0500 Subject: [PATCH 1/5] =?UTF-8?q?Creaci=C3=B3n=20masiva=20de=20inmuebles=20S?= =?UTF-8?q?e=20implementa=20la=20creaci=C3=B3n=20masiva=20de=20inmuebles?= =?UTF-8?q?=20a=20partir=20de=20par=C3=A1metros=20como=20cantidad=20de=20i?= =?UTF-8?q?nmuebles=20y=20pisos=20por=20inmueble.=20Adicionalmente=20se=20?= =?UTF-8?q?quitan=20dependencias=20no=20usadas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- central/templates/central_create.html | 250 ++------------------------ central/views.py | 49 ++--- requirements.txt | 5 +- 3 files changed, 36 insertions(+), 268 deletions(-) diff --git a/central/templates/central_create.html b/central/templates/central_create.html index 930f2ff..5ff05b8 100644 --- a/central/templates/central_create.html +++ b/central/templates/central_create.html @@ -12,270 +12,54 @@ {% endblock navbar %} {% block content %} - -
{% csrf_token %}
Massive Creation

Hello User Central! You can create massive apartment complexes and more.

+
- - +
- +
- - +
- +
- - +
- +
- -
{% endblock %} - diff --git a/central/views.py b/central/views.py index 866b252..c192e80 100644 --- a/central/views.py +++ b/central/views.py @@ -1,9 +1,9 @@ -from django.shortcuts import render, redirect +from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.models import User from .notificator import send_email -from map.models import Neighborhood +from map.models import Neighborhood, Place, Floor def user_can_see(user): @@ -20,36 +20,23 @@ def central_home(request): @login_required def central_create(request): if request.method == "POST": - print 'aqui' - savedNeighborhood = request.POST.get("neighborhood", "") - savedBuilder = request.POST.get("builder", "") - savedPlaceName = request.POST.get("placeName", "") - savedPlace = request.POST.get("place", "") - savedNumTowers = request.POST.get("numTowers", "") - savedNumFloors = request.POST.get("numFloors", "") - savedNumApartments = request.POST.get("numApartments", "") - savedUrlApto = request.POST.get("urlApto", "") - savedNumBlocks = request.POST.get("numBlocks", "") - savedNumFloorsHouse = request.POST.get("numFloorsHouse", "") - savedNumHouses = request.POST.get("numHouses", "") - savedUrlHouses1 = request.POST.get("urlHouses1", "") - savedUrlHouses2 = request.POST.get("urlHouses2", "") - print savedNeighborhood - print 'place' - print savedPlace - if savedPlace == '1': - print 'if 1' - elif savedPlace == '2': - print 'if 2' - elif savedPlace == '3': - print 'if 3' - context = {'user': request.user} - return render(request, 'central_create.html', context) + neigh_unicode = request.POST.get("neighborhood", "") + neighborhood = get_object_or_404(Neighborhood, pk=neigh_unicode) + name = str(request.POST.get("name", "")) + floors = int(request.POST.get("floors", "0")) + places = int(request.POST.get("places", "0")) + map_url = str(request.POST.get("map", "")) + + for _ in range(places): + place = Place(owner=request.user, neighborhood=neighborhood, name=name) + place.save() + for j in range(floors): + floor = Floor(place=place, number=(j+1), map=map_url) + floor.save() + return redirect('central_home') else: - print 'aqui2' - userbuilder = User.objects.all() - neighborhood = Neighborhood.objects.all().order_by('name') - context = {'user': request.user, 'neighborhood': neighborhood, 'userbuilder': userbuilder} + neighborhoods = Neighborhood.objects.all().order_by('name') + context = {'neighborhoods': neighborhoods} return render(request, 'central_create.html', context) diff --git a/requirements.txt b/requirements.txt index 29aa508..ea0e173 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,10 @@ dj-database-url==0.3.0 dj-static==0.0.6 Django==1.6.10 -django-kronos==0.6 +django-registration==1.0 django-toolbelt==0.0.1 -django-widget-tweaks==1.3 djangorestframework==3.0.5 gunicorn==19.2.1 nose==1.3.4 -Pillow==2.7.0 psycopg2==2.6 static3==0.5.1 -django-registration==1.0 From 6b2754ed995b5e9cbe6269e73b078f2e29930f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Felipe=20Esguerra=20Restrepo?= Date: Thu, 9 Apr 2015 15:17:19 -0500 Subject: [PATCH 2/5] =?UTF-8?q?Validaciones=20creaci=C3=B3n=20de=20usuario?= =?UTF-8?q?=20Se=20cambian=20las=20validaciones=20del=20formulario=20a=20c?= =?UTF-8?q?=C3=B3digo=20m=C3=A1s=20sencillo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- central/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/central/views.py b/central/views.py index c192e80..387289b 100644 --- a/central/views.py +++ b/central/views.py @@ -48,9 +48,10 @@ def central_owner_principal(request): @login_required def central_individual_load(request): - if 'username' in request.GET and request.GET['username'] and 'name' in request.GET and request.GET[ - 'name'] and 'lastname' in request.GET and request.GET['lastname'] and 'email' in request.GET and request.GET[ - 'email']: + if request.GET.get('username') \ + and request.GET.get('name') \ + and request.GET.get('lastname') \ + and request.GET.get('email'): userC = User.objects.create_user(username=request.GET['username'], first_name=request.GET['name'], last_name=request.GET['lastname'], email=request.GET['email'], password='DOMOTINA123') From 4027b4bfcfd30988e2c58126545859b0947bdaa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Felipe=20Esguerra=20Restrepo?= Date: Thu, 9 Apr 2015 15:42:21 -0500 Subject: [PATCH 3/5] Imagen de estado de evento Se incluye la imagen del estado del evento en las tablas de alarmas y eventos --- map/templates/place_details.html | 9 +++++---- map/templatetags/__init__.py | 0 map/templatetags/event_status.py | 8 ++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 map/templatetags/__init__.py create mode 100644 map/templatetags/event_status.py diff --git a/map/templates/place_details.html b/map/templates/place_details.html index 21477bd..923561d 100644 --- a/map/templates/place_details.html +++ b/map/templates/place_details.html @@ -1,5 +1,6 @@ {% extends "base.html"%} {% load static %} +{% load event_status %} {% block title %} - Place {{floor.place}} @@ -139,7 +140,7 @@

ALARMS

Date Time - Sensor + Asset Description @@ -149,7 +150,7 @@

ALARMS

{{alarm.event.timestamp.date}} {{alarm.event.timestamp.time}} {{alarm.event.sensor}} - {{alarm}} + {% status_icon alarm.event %}{{alarm}} {% endfor %} @@ -193,7 +194,7 @@

EVENTS

Date Time - Sensor + Asset Description @@ -203,7 +204,7 @@

EVENTS

{{event.timestamp.date}} {{event.timestamp.time}} {{event.sensor}} - {{event}} + {% status_icon event %}{{event}} {% endfor %} diff --git a/map/templatetags/__init__.py b/map/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/map/templatetags/event_status.py b/map/templatetags/event_status.py new file mode 100644 index 0000000..0859c11 --- /dev/null +++ b/map/templatetags/event_status.py @@ -0,0 +1,8 @@ +from django import template + +register = template.Library() + + +@register.simple_tag +def status_icon(event): + return '' \ No newline at end of file From aab8b9e9ef791b9e8f458c5bbbeb4f6e8feb5f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Felipe=20Esguerra=20Restrepo?= Date: Thu, 9 Apr 2015 15:43:30 -0500 Subject: [PATCH 4/5] =?UTF-8?q?Formulario=20sensores=20Se=20cambia=20Descr?= =?UTF-8?q?iption=20por=20Asset=20para=20que=20sea=20m=C3=A1s=20f=C3=A1cil?= =?UTF-8?q?=20de=20entender?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- map/templates/sensor_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map/templates/sensor_form.html b/map/templates/sensor_form.html index efd584c..19db53c 100644 --- a/map/templates/sensor_form.html +++ b/map/templates/sensor_form.html @@ -53,7 +53,7 @@

{{ place.name }}

- +
From 8e969e0e178ef69ced311fe176403c5c0b9146fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Felipe=20Esguerra=20Restrepo?= Date: Thu, 9 Apr 2015 15:54:08 -0500 Subject: [PATCH 5/5] =?UTF-8?q?Correcci=C3=B3n=20datos=20im=C3=A1genes=20S?= =?UTF-8?q?e=20cambia=20las=20URL=20de=20las=20im=C3=A1genes=20para=20usar?= =?UTF-8?q?=20el=20repositorio=20de=20github.=20Se=20reordena=20el=20formu?= =?UTF-8?q?lario=20de=20creaci=C3=B3n=20de=20sensores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- map/fixtures/initial_data.json | 745 ++++++++++++++++++++------------- map/templates/sensor_form.html | 8 +- 2 files changed, 456 insertions(+), 297 deletions(-) diff --git a/map/fixtures/initial_data.json b/map/fixtures/initial_data.json index 1513c3d..8cb4841 100644 --- a/map/fixtures/initial_data.json +++ b/map/fixtures/initial_data.json @@ -1,505 +1,664 @@ [ { "pk": 1, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "add_logentry", - "name": "Can add log entry", - "content_type": 1 + "model": "logentry", + "name": "log entry", + "app_label": "admin" } }, { "pk": 2, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "change_logentry", - "name": "Can change log entry", - "content_type": 1 + "model": "permission", + "name": "permission", + "app_label": "auth" } }, { "pk": 3, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "delete_logentry", - "name": "Can delete log entry", - "content_type": 1 + "model": "group", + "name": "group", + "app_label": "auth" } }, { "pk": 4, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "add_permission", - "name": "Can add permission", - "content_type": 2 + "model": "user", + "name": "user", + "app_label": "auth" } }, { "pk": 5, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "change_permission", - "name": "Can change permission", - "content_type": 2 + "model": "contenttype", + "name": "content type", + "app_label": "contenttypes" } }, { "pk": 6, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "delete_permission", - "name": "Can delete permission", - "content_type": 2 + "model": "session", + "name": "session", + "app_label": "sessions" } }, { "pk": 7, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "add_group", - "name": "Can add group", - "content_type": 3 + "model": "event", + "name": "event", + "app_label": "event_manager" } }, { "pk": 8, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "change_group", - "name": "Can change group", - "content_type": 3 + "model": "alarm", + "name": "alarm", + "app_label": "event_manager" } }, { "pk": 9, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "delete_group", - "name": "Can delete group", - "content_type": 3 + "model": "neighborhood", + "name": "neighborhood", + "app_label": "map" } }, { "pk": 10, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "add_user", - "name": "Can add user", - "content_type": 4 + "model": "place", + "name": "place", + "app_label": "map" } }, { "pk": 11, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "change_user", - "name": "Can change user", - "content_type": 4 + "model": "floor", + "name": "floor", + "app_label": "map" } }, { "pk": 12, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "delete_user", - "name": "Can delete user", - "content_type": 4 + "model": "sensortype", + "name": "sensor type", + "app_label": "map" } }, { "pk": 13, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "add_contenttype", - "name": "Can add content type", - "content_type": 5 + "model": "sensorstatus", + "name": "sensor status", + "app_label": "map" } }, { "pk": 14, - "model": "auth.permission", + "model": "contenttypes.contenttype", "fields": { - "codename": "change_contenttype", - "name": "Can change content type", - "content_type": 5 + "model": "sensor", + "name": "sensor", + "app_label": "map" } }, { "pk": 15, - "model": "auth.permission", + "model": "contenttypes.contenttype", + "fields": { + "model": "scheduledaily", + "name": "Daily Schedule", + "app_label": "rule_engine" + } +}, +{ + "pk": 1, + "model": "auth.permission", + "fields": { + "codename": "add_logentry", + "name": "Can add log entry", + "content_type": 1 + } +}, +{ + "pk": 2, + "model": "auth.permission", + "fields": { + "codename": "change_logentry", + "name": "Can change log entry", + "content_type": 1 + } +}, +{ + "pk": 3, + "model": "auth.permission", + "fields": { + "codename": "delete_logentry", + "name": "Can delete log entry", + "content_type": 1 + } +}, +{ + "pk": 4, + "model": "auth.permission", + "fields": { + "codename": "add_permission", + "name": "Can add permission", + "content_type": 2 + } +}, +{ + "pk": 5, + "model": "auth.permission", + "fields": { + "codename": "change_permission", + "name": "Can change permission", + "content_type": 2 + } +}, +{ + "pk": 6, + "model": "auth.permission", + "fields": { + "codename": "delete_permission", + "name": "Can delete permission", + "content_type": 2 + } +}, +{ + "pk": 7, + "model": "auth.permission", + "fields": { + "codename": "add_group", + "name": "Can add group", + "content_type": 3 + } +}, +{ + "pk": 8, + "model": "auth.permission", + "fields": { + "codename": "change_group", + "name": "Can change group", + "content_type": 3 + } +}, +{ + "pk": 9, + "model": "auth.permission", + "fields": { + "codename": "delete_group", + "name": "Can delete group", + "content_type": 3 + } +}, +{ + "pk": 10, + "model": "auth.permission", + "fields": { + "codename": "add_user", + "name": "Can add user", + "content_type": 4 + } +}, +{ + "pk": 11, + "model": "auth.permission", + "fields": { + "codename": "change_user", + "name": "Can change user", + "content_type": 4 + } +}, +{ + "pk": 12, + "model": "auth.permission", + "fields": { + "codename": "delete_user", + "name": "Can delete user", + "content_type": 4 + } +}, +{ + "pk": 13, + "model": "auth.permission", "fields": { - "codename": "delete_contenttype", - "name": "Can delete content type", + "codename": "add_contenttype", + "name": "Can add content type", "content_type": 5 } }, { - "pk": 16, - "model": "auth.permission", + "pk": 14, + "model": "auth.permission", + "fields": { + "codename": "change_contenttype", + "name": "Can change content type", + "content_type": 5 + } +}, +{ + "pk": 15, + "model": "auth.permission", + "fields": { + "codename": "delete_contenttype", + "name": "Can delete content type", + "content_type": 5 + } +}, +{ + "pk": 16, + "model": "auth.permission", "fields": { - "codename": "add_session", - "name": "Can add session", + "codename": "add_session", + "name": "Can add session", "content_type": 6 } }, { - "pk": 17, - "model": "auth.permission", + "pk": 17, + "model": "auth.permission", "fields": { - "codename": "change_session", - "name": "Can change session", + "codename": "change_session", + "name": "Can change session", "content_type": 6 } }, { - "pk": 18, - "model": "auth.permission", + "pk": 18, + "model": "auth.permission", "fields": { - "codename": "delete_session", - "name": "Can delete session", + "codename": "delete_session", + "name": "Can delete session", "content_type": 6 } }, { - "pk": 19, - "model": "auth.permission", + "pk": 19, + "model": "auth.permission", "fields": { - "codename": "add_event", - "name": "Can add event", + "codename": "add_event", + "name": "Can add event", "content_type": 7 } }, { - "pk": 20, - "model": "auth.permission", + "pk": 20, + "model": "auth.permission", "fields": { - "codename": "change_event", - "name": "Can change event", + "codename": "change_event", + "name": "Can change event", "content_type": 7 } }, { - "pk": 21, - "model": "auth.permission", + "pk": 21, + "model": "auth.permission", "fields": { - "codename": "delete_event", - "name": "Can delete event", + "codename": "delete_event", + "name": "Can delete event", "content_type": 7 } }, { - "pk": 22, - "model": "auth.permission", + "pk": 22, + "model": "auth.permission", "fields": { - "codename": "add_alarm", - "name": "Can add alarm", + "codename": "add_alarm", + "name": "Can add alarm", "content_type": 8 } }, { - "pk": 23, - "model": "auth.permission", + "pk": 23, + "model": "auth.permission", "fields": { - "codename": "change_alarm", - "name": "Can change alarm", + "codename": "change_alarm", + "name": "Can change alarm", "content_type": 8 } }, { - "pk": 24, - "model": "auth.permission", + "pk": 24, + "model": "auth.permission", "fields": { - "codename": "delete_alarm", - "name": "Can delete alarm", + "codename": "delete_alarm", + "name": "Can delete alarm", "content_type": 8 } }, { - "pk": 25, - "model": "auth.permission", + "pk": 25, + "model": "auth.permission", "fields": { - "codename": "add_neighborhood", - "name": "Can add neighborhood", + "codename": "add_neighborhood", + "name": "Can add neighborhood", "content_type": 9 } }, { - "pk": 26, - "model": "auth.permission", + "pk": 26, + "model": "auth.permission", "fields": { - "codename": "change_neighborhood", - "name": "Can change neighborhood", + "codename": "change_neighborhood", + "name": "Can change neighborhood", "content_type": 9 } }, { - "pk": 27, - "model": "auth.permission", + "pk": 27, + "model": "auth.permission", "fields": { - "codename": "delete_neighborhood", - "name": "Can delete neighborhood", + "codename": "delete_neighborhood", + "name": "Can delete neighborhood", "content_type": 9 } }, { - "pk": 28, - "model": "auth.permission", + "pk": 28, + "model": "auth.permission", "fields": { - "codename": "add_place", - "name": "Can add place", + "codename": "add_place", + "name": "Can add place", "content_type": 10 } }, { - "pk": 29, - "model": "auth.permission", + "pk": 29, + "model": "auth.permission", "fields": { - "codename": "change_place", - "name": "Can change place", + "codename": "change_place", + "name": "Can change place", "content_type": 10 } }, { - "pk": 30, - "model": "auth.permission", + "pk": 30, + "model": "auth.permission", "fields": { - "codename": "delete_place", - "name": "Can delete place", + "codename": "delete_place", + "name": "Can delete place", "content_type": 10 } }, { - "pk": 31, - "model": "auth.permission", + "pk": 31, + "model": "auth.permission", "fields": { - "codename": "add_floor", - "name": "Can add floor", + "codename": "add_floor", + "name": "Can add floor", "content_type": 11 } }, { - "pk": 32, - "model": "auth.permission", + "pk": 32, + "model": "auth.permission", "fields": { - "codename": "change_floor", - "name": "Can change floor", + "codename": "change_floor", + "name": "Can change floor", "content_type": 11 } }, { - "pk": 33, - "model": "auth.permission", + "pk": 33, + "model": "auth.permission", "fields": { - "codename": "delete_floor", - "name": "Can delete floor", + "codename": "delete_floor", + "name": "Can delete floor", "content_type": 11 } }, { - "pk": 34, - "model": "auth.permission", + "pk": 34, + "model": "auth.permission", "fields": { - "codename": "add_sensortype", - "name": "Can add sensor type", + "codename": "add_sensortype", + "name": "Can add sensor type", "content_type": 12 } }, { - "pk": 35, - "model": "auth.permission", + "pk": 35, + "model": "auth.permission", "fields": { - "codename": "change_sensortype", - "name": "Can change sensor type", + "codename": "change_sensortype", + "name": "Can change sensor type", "content_type": 12 } }, { - "pk": 36, - "model": "auth.permission", + "pk": 36, + "model": "auth.permission", "fields": { - "codename": "delete_sensortype", - "name": "Can delete sensor type", + "codename": "delete_sensortype", + "name": "Can delete sensor type", "content_type": 12 } }, { - "pk": 37, - "model": "auth.permission", + "pk": 37, + "model": "auth.permission", "fields": { - "codename": "add_sensorstatus", - "name": "Can add sensor status", + "codename": "add_sensorstatus", + "name": "Can add sensor status", "content_type": 13 } }, { - "pk": 38, - "model": "auth.permission", + "pk": 38, + "model": "auth.permission", "fields": { - "codename": "change_sensorstatus", - "name": "Can change sensor status", + "codename": "change_sensorstatus", + "name": "Can change sensor status", "content_type": 13 } }, { - "pk": 39, - "model": "auth.permission", + "pk": 39, + "model": "auth.permission", "fields": { - "codename": "delete_sensorstatus", - "name": "Can delete sensor status", + "codename": "delete_sensorstatus", + "name": "Can delete sensor status", "content_type": 13 } }, { - "pk": 40, - "model": "auth.permission", + "pk": 40, + "model": "auth.permission", "fields": { - "codename": "add_sensor", - "name": "Can add sensor", + "codename": "add_sensor", + "name": "Can add sensor", "content_type": 14 } }, { - "pk": 41, - "model": "auth.permission", + "pk": 41, + "model": "auth.permission", "fields": { - "codename": "change_sensor", - "name": "Can change sensor", + "codename": "change_sensor", + "name": "Can change sensor", "content_type": 14 } }, { - "pk": 42, - "model": "auth.permission", + "pk": 42, + "model": "auth.permission", "fields": { - "codename": "delete_sensor", - "name": "Can delete sensor", + "codename": "delete_sensor", + "name": "Can delete sensor", "content_type": 14 } }, { - "pk": 43, - "model": "auth.permission", + "pk": 43, + "model": "auth.permission", "fields": { - "codename": "add_scheduledaily", - "name": "Can add Daily Schedule", + "codename": "add_scheduledaily", + "name": "Can add Daily Schedule", "content_type": 15 } }, { - "pk": 44, - "model": "auth.permission", + "pk": 44, + "model": "auth.permission", "fields": { - "codename": "change_scheduledaily", - "name": "Can change Daily Schedule", + "codename": "change_scheduledaily", + "name": "Can change Daily Schedule", "content_type": 15 } }, { - "pk": 45, - "model": "auth.permission", + "pk": 45, + "model": "auth.permission", "fields": { - "codename": "delete_scheduledaily", - "name": "Can delete Daily Schedule", + "codename": "delete_scheduledaily", + "name": "Can delete Daily Schedule", "content_type": 15 } }, { - "pk": 1, - "model": "auth.group", + "pk": 1, + "model": "auth.group", "fields": { - "name": "UsersCentral", + "name": "UsersCentral", "permissions": [ 2 ] } }, { - "pk": 2, - "model": "auth.group", + "pk": 2, + "model": "auth.group", "fields": { - "name": "UsersOwners", + "name": "UsersOwners", "permissions": [ - 34, - 35, + 34, + 35, 36 ] } }, { - "pk": 1, - "model": "auth.user", - "fields": { - "username": "domotina", - "first_name": "", - "last_name": "", - "is_active": true, - "is_superuser": true, - "is_staff": true, - "last_login": "2015-03-28T00:56:55.518Z", - "groups": [], - "user_permissions": [], - "password": "pbkdf2_sha256$12000$jTeDaK4UwLqY$ytI9/vmZ15Z6Kvj8xKPmQCXGJlKBOcRPeDKxcXPRfBo=", - "email": "djimenez@ingenieros.com", + "pk": 1, + "model": "auth.user", + "fields": { + "username": "domotina", + "first_name": "", + "last_name": "", + "is_active": true, + "is_superuser": true, + "is_staff": true, + "last_login": "2015-04-09T20:04:32.034Z", + "groups": [], + "user_permissions": [], + "password": "pbkdf2_sha256$12000$jTeDaK4UwLqY$ytI9/vmZ15Z6Kvj8xKPmQCXGJlKBOcRPeDKxcXPRfBo=", + "email": "djimenez@ingenieros.com", "date_joined": "2015-03-07T20:01:23Z" } }, { - "pk": 2, - "model": "auth.user", - "fields": { - "username": "central", - "first_name": "Usuario", - "last_name": "Central", - "is_active": true, - "is_superuser": false, - "is_staff": false, - "last_login": "2015-03-21T22:13:26.308Z", + "pk": 2, + "model": "auth.user", + "fields": { + "username": "central", + "first_name": "Usuario", + "last_name": "Central", + "is_active": true, + "is_superuser": false, + "is_staff": false, + "last_login": "2015-03-21T22:13:26.308Z", "groups": [ 1 - ], - "user_permissions": [], - "password": "pbkdf2_sha256$12000$c59nhEY8EnFF$UbXvE/gDmDc2n928B9D+wN5wf9RojB/4r9TYmg/OYB0=", - "email": "raul.gomezn@hotmail.com", + ], + "user_permissions": [], + "password": "pbkdf2_sha256$12000$c59nhEY8EnFF$UbXvE/gDmDc2n928B9D+wN5wf9RojB/4r9TYmg/OYB0=", + "email": "raul.gomezn@hotmail.com", "date_joined": "2015-03-21T15:59:16Z" } }, { - "pk": 3, - "model": "auth.user", - "fields": { - "username": "user", - "first_name": "Usuario", - "last_name": "Propietario", - "is_active": true, - "is_superuser": false, - "is_staff": false, - "last_login": "2015-03-21T22:12:47.770Z", + "pk": 3, + "model": "auth.user", + "fields": { + "username": "user", + "first_name": "Usuario", + "last_name": "Propietario", + "is_active": true, + "is_superuser": false, + "is_staff": false, + "last_login": "2015-03-21T22:12:47.770Z", "groups": [ 2 - ], - "user_permissions": [], - "password": "pbkdf2_sha256$12000$VWJRLICOiKez$CtVqE1CjkxHkePTyXaw4ckodgDViaNIGfkCLPiyvcXc=", - "email": "raul.gomezn@hotmail.com", + ], + "user_permissions": [], + "password": "pbkdf2_sha256$12000$VWJRLICOiKez$CtVqE1CjkxHkePTyXaw4ckodgDViaNIGfkCLPiyvcXc=", + "email": "raul.gomezn@hotmail.com", "date_joined": "2015-03-21T17:21:32Z" } }, { - "pk": 4, - "model": "auth.user", - "fields": - {"username": "buildersmart", - "first_name": "Constructora", - "last_name": "Smart", - "is_active": true, - "is_superuser": false, - "is_staff": false, - "last_login": "2015-04-07T20:31:31Z", - "groups": [2], - "user_permissions": [], - "password": "pbkdf2_sha256$12000$FkGl9x3UtHYP$48YYbAYdLDAXisurv687PPAy0fDbyqwGK+CyVKCUMBY=", - "email": "ra.gomez11@uniandes.edu.co", - "date_joined": "2015-04-07T20:31:31Z"}}, + "pk": 4, + "model": "auth.user", + "fields": { + "username": "buildersmart", + "first_name": "Constructora", + "last_name": "Smart", + "is_active": true, + "is_superuser": false, + "is_staff": false, + "last_login": "2015-04-07T20:31:31Z", + "groups": [ + 2 + ], + "user_permissions": [], + "password": "pbkdf2_sha256$12000$FkGl9x3UtHYP$48YYbAYdLDAXisurv687PPAy0fDbyqwGK+CyVKCUMBY=", + "email": "ra.gomez11@uniandes.edu.co", + "date_joined": "2015-04-07T20:31:31Z" + } +}, +{ + "pk": 5, + "model": "auth.user", + "fields": { + "username": "kaos", + "first_name": "a", + "last_name": "e", + "is_active": true, + "is_superuser": false, + "is_staff": false, + "last_login": "2015-04-09T20:14:16.761Z", + "groups": [ + 2 + ], + "user_permissions": [], + "password": "pbkdf2_sha256$12000$xPjRrVS8DoGk$6KEiFopXiDRXDIL0w7Kfds6tBAnxmehzyW73Hs2ZbQ4=", + "email": "kaosterra@gmail.com", + "date_joined": "2015-04-09T20:14:16.761Z" + } +}, { "pk": 1, "model": "map.neighborhood", @@ -537,57 +696,57 @@ } }, { - "pk": 1, - "model": "map.place", + "pk": 1, + "model": "map.place", "fields": { - "owner": 1, - "date_created": "2015-03-07T20:59:03.888Z", - "neighborhood": 1, - "name": "T10 AP602", + "owner": 1, + "date_created": "2015-03-07T20:59:03.888Z", + "neighborhood": 1, + "name": "T10 AP602", "date_updated": "2015-03-07T20:59:03.888Z" } }, { - "pk": 2, - "model": "map.place", + "pk": 2, + "model": "map.place", "fields": { - "owner": 1, - "date_created": "2015-03-07T20:59:27.651Z", - "neighborhood": 1, - "name": "T10 AP603", + "owner": 1, + "date_created": "2015-03-07T20:59:27.651Z", + "neighborhood": 1, + "name": "T10 AP603", "date_updated": "2015-03-07T20:59:27.651Z" } }, { - "pk": 3, - "model": "map.place", + "pk": 3, + "model": "map.place", "fields": { - "owner": 1, - "date_created": "2015-03-08T02:24:08.983Z", - "neighborhood": 3, - "name": "Kr 69D St 25-04", + "owner": 1, + "date_created": "2015-03-08T02:24:08.983Z", + "neighborhood": 3, + "name": "Kr 69D St 25-04", "date_updated": "2015-03-08T02:24:08.983Z" } }, { - "pk": 4, - "model": "map.place", + "pk": 4, + "model": "map.place", "fields": { - "owner": 1, - "date_created": "2015-03-08T03:37:22.536Z", - "neighborhood": 4, - "name": "Office 201", + "owner": 1, + "date_created": "2015-03-08T03:37:22.536Z", + "neighborhood": 4, + "name": "Office 201", "date_updated": "2015-03-08T03:37:22.536Z" } }, { - "pk": 5, - "model": "map.place", + "pk": 5, + "model": "map.place", "fields": { - "owner": 1, - "date_created": "2015-03-17T17:24:15.155Z", - "neighborhood": 3, - "name": "Kr 69A St 24-12", + "owner": 1, + "date_created": "2015-03-17T17:24:15.155Z", + "neighborhood": 3, + "name": "Kr 69A St 24-12", "date_updated": "2015-03-17T17:24:15.155Z" } }, @@ -596,7 +755,7 @@ "model": "map.floor", "fields": { "date_updated": "2015-03-08T03:37:22.536Z", - "map": "http://calculadora.site90.net/images/ap_model1.png", + "map": "https://raw.githubusercontent.com/Domotina/FileBucket/master/maps/ap_model1.png", "place": 1, "number": 1, "date_created": "2015-03-08T03:37:22.536Z" @@ -607,7 +766,7 @@ "model": "map.floor", "fields": { "date_updated": "2015-03-08T03:37:22.536Z", - "map": "http://calculadora.site90.net/images/ap_model2.png", + "map": "https://raw.githubusercontent.com/Domotina/FileBucket/master/maps/ap_model2.png", "place": 2, "number": 1, "date_created": "2015-03-08T03:37:22.536Z" @@ -618,7 +777,7 @@ "model": "map.floor", "fields": { "date_updated": "2015-03-08T03:37:22.536Z", - "map": "http://calculadora.site90.net/images/ap_model3.png", + "map": "https://raw.githubusercontent.com/Domotina/FileBucket/master/maps/ap_model3.png", "place": 3, "number": 1, "date_created": "2015-03-08T03:37:22.536Z" @@ -629,7 +788,7 @@ "model": "map.floor", "fields": { "date_updated": "2015-03-08T03:37:22.536Z", - "map": "http://calculadora.site90.net/images/of_model1.png", + "map": "https://raw.githubusercontent.com/Domotina/FileBucket/master/maps/of_model1.png", "place": 4, "number": 1, "date_created": "2015-03-08T03:37:22.536Z" @@ -640,7 +799,7 @@ "model": "map.floor", "fields": { "date_updated": "2015-03-17T17:25:33.362Z", - "map": "http://calculadora.site90.net/images/ap_model6_p1.png", + "map": "https://raw.githubusercontent.com/Domotina/FileBucket/master/maps/ap_model6_p1.png", "place": 5, "number": 1, "date_created": "2015-03-17T17:25:33.362Z" @@ -651,7 +810,7 @@ "model": "map.floor", "fields": { "date_updated": "2015-03-17T17:25:52.885Z", - "map": "http://calculadora.site90.net/images/ap_model6_p2.png", + "map": "https://raw.githubusercontent.com/Domotina/FileBucket/master/maps/ap_model6_p2.png", "place": 5, "number": 2, "date_created": "2015-03-17T17:25:52.885Z" @@ -693,9 +852,9 @@ "max_value": 0, "min_value": 0, "value": 1, - "msg": "", + "msg": " ", "type": 2, - "icon": "http://calculadora.site90.net/images/lock_icon.png" + "icon": "https://raw.githubusercontent.com/Domotina/FileBucket/master/sensors/lock_icon.png" } }, { @@ -707,9 +866,9 @@ "max_value": 0, "min_value": 0, "value": 0, - "msg": "", + "msg": " ", "type": 2, - "icon": "http://calculadora.site90.net/images/unlock_icon.png" + "icon": "https://raw.githubusercontent.com/Domotina/FileBucket/master/sensors/unlock_icon.png" } }, { @@ -721,9 +880,9 @@ "max_value": 0, "min_value": 0, "value": 1, - "msg": "", + "msg": " ", "type": 3, - "icon": "http://calculadora.site90.net/images/bulb_on.png" + "icon": "https://raw.githubusercontent.com/Domotina/FileBucket/master/sensors/bulb_on.png" } }, { @@ -735,9 +894,9 @@ "max_value": 0, "min_value": 0, "value": 0, - "msg": "", + "msg": " ", "type": 3, - "icon": "http://calculadora.site90.net/images/bulb_off.png" + "icon": "https://raw.githubusercontent.com/Domotina/FileBucket/master/sensors/bulb_off.png" } }, { @@ -749,9 +908,9 @@ "max_value": 0, "min_value": 0, "value": 1, - "msg": "", + "msg": "There was movement", "type": 1, - "icon": "http://calculadora.site90.net/images/move.png" + "icon": "https://raw.githubusercontent.com/Domotina/FileBucket/master/sensors/move.png" } }, { @@ -763,9 +922,9 @@ "max_value": 0, "min_value": 0, "value": 0, - "msg": "", + "msg": " ", "type": 1, - "icon": "http://calculadora.site90.net/images/no_move.png" + "icon": "https://raw.githubusercontent.com/Domotina/FileBucket/master/sensors/no_move.png" } }, { @@ -1270,7 +1429,7 @@ "current_pos_x": 195, "description": "Study Room Laptop", "floor": 5, - "date_updated": "2015-03-28T00:57:03.727Z", + "date_updated": "2015-04-09T20:04:14.204Z", "current_date": "2015-03-28T00:57:03.695Z", "current_value": 0, "date_created": "2015-03-17T21:48:16.956Z", diff --git a/map/templates/sensor_form.html b/map/templates/sensor_form.html index 19db53c..20b5e5f 100644 --- a/map/templates/sensor_form.html +++ b/map/templates/sensor_form.html @@ -20,6 +20,10 @@

{{ place.name }}

{% csrf_token %}
New Sensor +
+ + +
-
- - -