Commits

Patrick Guido Arminio committed 0a2b893

Aggiungo campo per i dispositivi GCM

Comments (0)

Files changed (2)

projectmensa/menu/migrations/0013_auto__add_devices.py

+# 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 'Devices'
+        db.create_table('menu_devices', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('key', self.gf('django.db.models.fields.CharField')(max_length=200)),
+        ))
+        db.send_create_signal('menu', ['Devices'])
+
+
+    def backwards(self, orm):
+        
+        # Deleting model 'Devices'
+        db.delete_table('menu_devices')
+
+
+    models = {
+        'menu.course': {
+            'Meta': {'object_name': 'Course'},
+            'alternative_description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
+            'type': ('django.db.models.fields.IntegerField', [], {})
+        },
+        'menu.devices': {
+            'Meta': {'object_name': 'Devices'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'key': ('django.db.models.fields.CharField', [], {'max_length': '200'})
+        },
+        'menu.menuoftheday': {
+            'Meta': {'object_name': 'MenuOfTheDay'},
+            'courses': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['menu.Course']", 'null': 'True', 'blank': 'True'}),
+            'day': ('django.db.models.fields.DateField', [], {'default': 'datetime.date(2012, 11, 29)', 'unique': 'True'}),
+            'downloaded_from': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+            'pdf': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+            'published': ('django.db.models.fields.BooleanField', [], {'default': 'False'})
+        },
+        'menu.typetoken': {
+            'Meta': {'object_name': 'TypeToken'},
+            'description': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'regex': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'token': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
+            'type': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
+        }
+    }
+
+    complete_apps = ['menu']

projectmensa/menu/models.py

 
     def __unicode__(self):
         return 'Menu for %s' % self.day
+
+
+class Devices(models.Model):
+    key = models.CharField(max_length=200)
+
+    class Meta(object):
+        verbose_name = _('Dispositivo')
+        verbose_name_plural = _('Dispositivi')