Oh, right
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Fri, 31 Jan 2014 15:00:33 +0000 (16:00 +0100)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Fri, 31 Jan 2014 15:00:33 +0000 (16:00 +0100)
publishers/__init__.py [new file with mode: 0644]
publishers/admin.py [new file with mode: 0644]
publishers/migrations/0001_initial.py [new file with mode: 0644]
publishers/migrations/__init__.py [new file with mode: 0644]
publishers/models.py [new file with mode: 0644]

diff --git a/publishers/__init__.py b/publishers/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/publishers/admin.py b/publishers/admin.py
new file mode 100644 (file)
index 0000000..5e2cf36
--- /dev/null
@@ -0,0 +1,4 @@
+from django.contrib import admin
+from .models import Publisher
+
+admin.site.register(Publisher)
diff --git a/publishers/migrations/0001_initial.py b/publishers/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..1a77507
--- /dev/null
@@ -0,0 +1,34 @@
+# -*- 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 model 'Publisher'
+        db.create_table(u'publishers_publisher', (
+            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
+            ('logo', self.gf('django.db.models.fields.files.ImageField')(max_length=100)),
+        ))
+        db.send_create_signal(u'publishers', ['Publisher'])
+
+
+    def backwards(self, orm):
+        # Deleting model 'Publisher'
+        db.delete_table(u'publishers_publisher')
+
+
+    models = {
+        u'publishers.publisher': {
+            'Meta': {'object_name': 'Publisher'},
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+        }
+    }
+
+    complete_apps = ['publishers']
\ No newline at end of file
diff --git a/publishers/migrations/__init__.py b/publishers/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/publishers/models.py b/publishers/models.py
new file mode 100644 (file)
index 0000000..10d1947
--- /dev/null
@@ -0,0 +1,8 @@
+from django.db import models
+
+class Publisher(models.Model):
+    name = models.CharField(max_length=255)
+    logo = models.ImageField(upload_to='publishers/logo')
+
+    def __unicode__(self):
+        return self.name