]> git.0d.be Git - django-panik-matos.git/commitdiff
add a field to know if the item is actually in use
authorFrédéric Péters <fpeters@0d.be>
Sat, 28 Jun 2014 09:56:42 +0000 (11:56 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sat, 28 Jun 2014 09:56:42 +0000 (11:56 +0200)
matos/migrations/0002_auto__add_field_piece_in_use.py [new file with mode: 0644]
matos/models.py

diff --git a/matos/migrations/0002_auto__add_field_piece_in_use.py b/matos/migrations/0002_auto__add_field_piece_in_use.py
new file mode 100644 (file)
index 0000000..d33fdad
--- /dev/null
@@ -0,0 +1,40 @@
+# -*- coding: 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 'Piece.in_use'
+        db.add_column(u'matos_piece', 'in_use',
+                      self.gf('django.db.models.fields.BooleanField')(default=False),
+                      keep_default=False)
+
+
+    def backwards(self, orm):
+        # Deleting field 'Piece.in_use'
+        db.delete_column(u'matos_piece', 'in_use')
+
+
+    models = {
+        u'matos.piece': {
+            'Meta': {'ordering': "['title']", 'object_name': 'Piece'},
+            'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'creation_timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '250', 'null': 'True', 'blank': 'True'}),
+            'in_use': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'last_update_timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'null': 'True', 'blank': 'True'}),
+            'location': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'purchase_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+            'purchase_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '10', 'decimal_places': '2', 'blank': 'True'}),
+            'reference': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
+            'rentable': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+        }
+    }
+
+    complete_apps = ['matos']
\ No newline at end of file
index 2e1973ac6b1ac2fb1034349c9fed7e2a9b10cc60..f8050281d6aaf415dbf0ea6c3f429ca3f2777aec 100644 (file)
@@ -16,6 +16,7 @@ class Piece(models.Model):
     image = models.ImageField(_('Picture'),
             upload_to='matos', max_length=250, null=True, blank=True)
 
+    in_use = models.BooleanField(_('In use'), default=False)
     rentable = models.BooleanField(_('Rentable'), default=False)
 
     purchase_date = models.DateField(_('Purchase Date'), null=True, blank=True)