Permalink
Browse files

Merge branch 'master' of https://github.com/Illutron/IllutronDashboard

Conflicts:
	templates/dashboard.html
  • Loading branch information...
2 parents 5823d22 + 173272f commit da02439ebed81af6e96762fae8b461631df7d4b0 @HalfdanJ HalfdanJ committed Oct 9, 2011
Showing with 814 additions and 2 deletions.
  1. +6 −2 .gitignore
  2. 0 __init__.py
  3. +13 −0 apache/django.wsgi
  4. 0 apps/log/__init__.py
  5. +8 −0 apps/log/admin.py
  6. +108 −0 apps/log/migrations/0001_initial.py
  7. +89 −0 apps/log/migrations/0002_auto__chg_field_entry_longitude__chg_field_entry_latitude__chg_field_e.py
  8. +88 −0 apps/log/migrations/0003_auto__add_field_entry_member.py
  9. 0 apps/log/migrations/__init__.py
  10. +26 −0 apps/log/models.py
  11. +16 −0 apps/log/tests.py
  12. +17 −0 apps/log/urls.py
  13. +58 −0 apps/log/views.py
  14. 0 apps/profiles/__init__.py
  15. +6 −0 apps/profiles/admin.py
  16. +71 −0 apps/profiles/migrations/0001_initial.py
  17. 0 apps/profiles/migrations/__init__.py
  18. +12 −0 apps/profiles/models.py
  19. +16 −0 apps/profiles/tests.py
  20. +1 −0 apps/profiles/views.py
  21. 0 apps/sync/__init__.py
  22. 0 apps/sync/migrations/__init__.py
  23. +11 −0 apps/sync/models.py
  24. +60 −0 apps/sync/sync.py
  25. +16 −0 apps/sync/tests.py
  26. +1 −0 apps/sync/views.py
  27. BIN html/.sass-cache/120f56602294f138fa2a0d94e7bed1aeec0fd3eb/ie.scssc
  28. BIN html/.sass-cache/120f56602294f138fa2a0d94e7bed1aeec0fd3eb/print.scssc
  29. BIN html/.sass-cache/120f56602294f138fa2a0d94e7bed1aeec0fd3eb/screen.sassc
  30. BIN html/.sass-cache/1ea62f3e5aa4957f8e7fd8b95da48a00cbc08e8e/ie.scssc
  31. BIN html/.sass-cache/1ea62f3e5aa4957f8e7fd8b95da48a00cbc08e8e/print.scssc
  32. BIN html/.sass-cache/1ea62f3e5aa4957f8e7fd8b95da48a00cbc08e8e/screen.sassc
  33. BIN html/.sass-cache/2621575c5f966f9eb691431db12e865fdd4fd7a0/_base.sassc
  34. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_appearance.scssc
  35. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_background-clip.scssc
  36. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_background-origin.scssc
  37. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_background-size.scssc
  38. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_border-radius.scssc
  39. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_box-shadow.scssc
  40. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_box-sizing.scssc
  41. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_box.scssc
  42. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_columns.scssc
  43. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_font-face.scssc
  44. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_gradient.scssc
  45. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_images.scssc
  46. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_inline-block.scssc
  47. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_opacity.scssc
  48. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_shared.scssc
  49. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_text-shadow.scssc
  50. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_transform.scssc
  51. BIN html/.sass-cache/552c2ff9454325f387df983834b2331c3bf22054/_transition.scssc
  52. BIN html/.sass-cache/61a879e353332a6743a56b7d105cae890b6454cc/ie.scssc
  53. BIN html/.sass-cache/61a879e353332a6743a56b7d105cae890b6454cc/print.scssc
  54. BIN html/.sass-cache/61a879e353332a6743a56b7d105cae890b6454cc/screen.sassc
  55. BIN html/.sass-cache/7b585b124add732729cf49bca15cc5c458cd73b8/_base.sassc
  56. BIN html/.sass-cache/7c17c5c252c693e7fb9d979622d50f9c15a64c39/_utilities.scssc
  57. BIN html/.sass-cache/a4b6a372988651c0645c7cd2f883b75cb87e190c/_clearfix.scssc
  58. BIN html/.sass-cache/a4b6a372988651c0645c7cd2f883b75cb87e190c/_hacks.scssc
  59. BIN html/.sass-cache/d1b815ffbd075e4ffb86d3300f8f3092795d4e29/_css3.scssc
  60. BIN html/.sass-cache/d1b815ffbd075e4ffb86d3300f8f3092795d4e29/_reset.scssc
  61. BIN html/.sass-cache/d1b815ffbd075e4ffb86d3300f8f3092795d4e29/_support.scssc
  62. BIN html/.sass-cache/e62f1cba5ef2812f66e89a1893601ba1cb52cce7/_base.sassc
  63. +14 −0 manage.py
  64. BIN media/images/praise/profile.jpg
  65. BIN media/images/profiles/304028_10150311928073062_739183061_8226634_842711399_n.jpg
  66. +14 −0 requirements.txt
  67. +134 −0 settings.py
  68. 0 {html → static}/coffee/main.coffee
  69. 0 {html → static}/config.rb
  70. BIN {html → static}/images/bg.jpg
  71. 0 {html → static}/javascripts/main.js
  72. 0 {html → static}/sass/ie.scss
  73. 0 {html → static}/sass/partials/_base.sass
  74. 0 {html → static}/sass/print.scss
  75. 0 {html → static}/sass/screen.sass
  76. 0 {html → static}/stylesheets/ie.css
  77. 0 {html → static}/stylesheets/print.css
  78. 0 {html → static}/stylesheets/screen.css
  79. 0 {html → static}/vendor/backbone-min.js
  80. 0 {html → static}/vendor/jquery-1.6.4.js
  81. 0 {html → static}/vendor/jquery-1.6.4.min.js
  82. 0 {html → static}/vendor/json/README
  83. 0 {html → static}/vendor/json/cycle.js
  84. 0 {html → static}/vendor/json/json.js
  85. 0 {html → static}/vendor/json/json2.js
  86. 0 {html → static}/vendor/json/json_parse.js
  87. 0 {html → static}/vendor/json/json_parse_state.js
  88. 0 {html → static}/vendor/underscore-min.js
  89. 0 {html → static}/vendor/underscore.js
  90. 0 templates/404.html
  91. 0 templates/500.html
  92. 0 html/index.html → templates/dashboard.html
  93. BIN test.db
  94. +25 −0 urls.py
  95. +4 −0 views.py
View
@@ -1,2 +1,6 @@
-/html/.sass-cache/
-.DS_Store
+/static/.sass-cache/
+.DS_Store
+.idea
+*pyc
+*~
+settings_local.py
View
No changes.
View
@@ -0,0 +1,13 @@
+import os
+import sys
+import site
+
+site.addsitedir('/home/illutron/.virtualenvs/IllutronDashboard/lib/python2.7/site-packages')
+
+sys.path.append('/home/illutron/srv/')
+sys.path.append('/home/illutron/srv/IllutronDashboard/')
+
+os.environ['DJANGO_SETTINGS_MODULE'] = 'IllutronDashboard.settings'
+
+import django.core.handlers.wsgi
+application = django.core.handlers.wsgi.WSGIHandler()
View
No changes.
View
@@ -0,0 +1,8 @@
+# -*- coding: utf-8 -*-
+
+from django.contrib import admin
+from models import Entry, Provider
+
+
+admin.site.register(Entry, admin.ModelAdmin)
+admin.site.register(Provider, admin.ModelAdmin)
@@ -0,0 +1,108 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Adding model 'Provider'
+ db.create_table('log_provider', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
+ ))
+ db.send_create_signal('log', ['Provider'])
+
+ # Adding model 'Entry'
+ db.create_table('log_entry', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
+ ('time', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
+ ('on_illutron', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('latitude', self.gf('django.db.models.fields.DecimalField')(max_digits=8, decimal_places=6, blank=True)),
+ ('longitude', self.gf('django.db.models.fields.DecimalField')(max_digits=8, decimal_places=6, blank=True)),
+ ('accuracy', self.gf('django.db.models.fields.IntegerField')(blank=True)),
+ ('provider', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['log.Provider'])),
+ ))
+ db.send_create_signal('log', ['Entry'])
+
+ # Adding M2M table for field member on 'Entry'
+ db.create_table('log_entry_member', (
+ ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+ ('entry', models.ForeignKey(orm['log.entry'], null=False)),
+ ('user', models.ForeignKey(orm['auth.user'], null=False))
+ ))
+ db.create_unique('log_entry_member', ['entry_id', 'user_id'])
+
+
+ def backwards(self, orm):
+
+ # Deleting model 'Provider'
+ db.delete_table('log_provider')
+
+ # Deleting model 'Entry'
+ db.delete_table('log_entry')
+
+ # Removing M2M table for field member on 'Entry'
+ db.delete_table('log_entry_member')
+
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'log.entry': {
+ 'Meta': {'object_name': 'Entry'},
+ 'accuracy': ('django.db.models.fields.IntegerField', [], {'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'latitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '6', 'blank': 'True'}),
+ 'longitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '6', 'blank': 'True'}),
+ 'member': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'symmetrical': 'False'}),
+ 'on_illutron': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'provider': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['log.Provider']"}),
+ 'time': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'})
+ },
+ 'log.provider': {
+ 'Meta': {'object_name': 'Provider'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '40'})
+ }
+ }
+
+ complete_apps = ['log']
@@ -0,0 +1,89 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Changing field 'Entry.longitude'
+ db.alter_column('log_entry', 'longitude', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=8, decimal_places=6))
+
+ # Changing field 'Entry.latitude'
+ db.alter_column('log_entry', 'latitude', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=8, decimal_places=6))
+
+ # Changing field 'Entry.accuracy'
+ db.alter_column('log_entry', 'accuracy', self.gf('django.db.models.fields.IntegerField')(null=True))
+
+
+ def backwards(self, orm):
+
+ # User chose to not deal with backwards NULL issues for 'Entry.longitude'
+ raise RuntimeError("Cannot reverse this migration. 'Entry.longitude' and its values cannot be restored.")
+
+ # User chose to not deal with backwards NULL issues for 'Entry.latitude'
+ raise RuntimeError("Cannot reverse this migration. 'Entry.latitude' and its values cannot be restored.")
+
+ # User chose to not deal with backwards NULL issues for 'Entry.accuracy'
+ raise RuntimeError("Cannot reverse this migration. 'Entry.accuracy' and its values cannot be restored.")
+
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'log.entry': {
+ 'Meta': {'object_name': 'Entry'},
+ 'accuracy': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'latitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '6', 'blank': 'True'}),
+ 'longitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '6', 'blank': 'True'}),
+ 'member': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'symmetrical': 'False'}),
+ 'on_illutron': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'provider': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['log.Provider']"}),
+ 'time': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'})
+ },
+ 'log.provider': {
+ 'Meta': {'object_name': 'Provider'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '40'})
+ }
+ }
+
+ complete_apps = ['log']
@@ -0,0 +1,88 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+
+ # Adding field 'Entry.member'
+ db.add_column('log_entry', 'member', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['auth.User']), keep_default=False)
+
+ # Removing M2M table for field member on 'Entry'
+ db.delete_table('log_entry_member')
+
+
+ def backwards(self, orm):
+
+ # Deleting field 'Entry.member'
+ db.delete_column('log_entry', 'member_id')
+
+ # Adding M2M table for field member on 'Entry'
+ db.create_table('log_entry_member', (
+ ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+ ('entry', models.ForeignKey(orm['log.entry'], null=False)),
+ ('user', models.ForeignKey(orm['auth.user'], null=False))
+ ))
+ db.create_unique('log_entry_member', ['entry_id', 'user_id'])
+
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'log.entry': {
+ 'Meta': {'object_name': 'Entry'},
+ 'accuracy': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'latitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '6', 'blank': 'True'}),
+ 'longitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '6', 'blank': 'True'}),
+ 'member': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+ 'on_illutron': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'provider': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['log.Provider']"}),
+ 'time': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'})
+ },
+ 'log.provider': {
+ 'Meta': {'object_name': 'Provider'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '40'})
+ }
+ }
+
+ complete_apps = ['log']
No changes.
View
@@ -0,0 +1,26 @@
+from django.db import models
+from django.contrib.auth.models import User
+import datetime
+
+class Provider(models.Model):
+ name = models.CharField(max_length=40)
+
+ def __unicode__(self):
+ return self.name
+
+class Entry(models.Model):
+ member = models.ForeignKey(User, related_name='log_entries')
+ description = models.TextField(blank=True)
+ time = models.DateTimeField(default=datetime.datetime.now)
+ on_illutron = models.BooleanField(default=False)
+ latitude = models.DecimalField(max_digits=8, decimal_places=6, blank=True, null=True)
+ longitude = models.DecimalField(max_digits=8, decimal_places=6, blank=True, null=True)
+ accuracy = models.IntegerField(blank=True, help_text="accuracy in meters.", null=True)
+ provider = models.ForeignKey(Provider)
+
+ def __unicode__(self):
+ s = ""
+ if not self.on_illutron:
+ s = " not"
+ return "%s is%s on Illutron" % (self.member.username, s)
+
Oops, something went wrong.

0 comments on commit da02439

Please sign in to comment.