Changeset 89
- Timestamp:
- 04/03/08 16:36:39 (5 months ago)
- Files:
-
- sucrose/trunk/www/src/sucrose (modified) (1 prop)
- sucrose/trunk/www/src/sucrose/machine (modified) (1 prop)
- sucrose/trunk/www/src/sucrose/machine/models.py (modified) (4 diffs)
- sucrose/trunk/www/src/sucrose/settings.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sucrose/trunk/www/src/sucrose
- Property svn:ignore set to
*.pyc
- Property svn:ignore set to
sucrose/trunk/www/src/sucrose/machine
- Property svn:ignore set to
*.pyc
- Property svn:ignore set to
sucrose/trunk/www/src/sucrose/machine/models.py
r88 r89 1 # This is an auto-generated Django model module.2 # You'll have to do the following manually to clean this up:3 # * Rearrange models' order4 # * Make sure each model has one field with primary_key=True5 # Feel free to rename the models, but don't rename db_table values or field names.6 #7 # Also note: You'll have to insert the output of 'django-admin.py sqlcustom [appname]'8 # into your database.9 10 1 from django.db import models 11 2 … … 13 4 item_id = models.IntegerField(primary_key=True) 14 5 name = models.CharField(max_length=765) 15 price = models.DecimalField( 4,2)6 price = models.DecimalField(max_digits=4, decimal_places=2) 16 7 num_consumed = models.IntegerField(null=True, blank=True) 17 8 tray_slot_size = models.CharField(max_length=39) … … 26 17 protein = models.IntegerField(null=True, blank=True) 27 18 cholesterol = models.IntegerField(null=True, blank=True) 19 28 20 class Meta: 29 21 db_table = u'items' 22 23 def __unicode__(self): 24 return '%s @ $%s' % (self.item.name, self.price) 30 25 31 26 class Trays(models.Model): … … 35 30 quantity = models.IntegerField() 36 31 machine = models.CharField(unique=True, max_length=24) 37 price = models.DecimalField(4, 2) 32 cur_price = models.DecimalField(max_digits=4, decimal_places=2) 33 38 34 class Meta: 39 35 db_table = u'trays' 40 36 37 def __unicode__(self): 38 return '%s tray %d: %d %s @ $%s' % ( 39 self.machine, self.machine_tray_id, self.quantity, 40 (self.item and self.item.name), self.cur_price) sucrose/trunk/www/src/sucrose/settings.py
r88 r89 78 78 'django.contrib.sessions', 79 79 'django.contrib.sites', 80 'sucrose.machine', 80 81 )
