From 8f939c57adbcfa3bb6f2ab9625881495140c4501 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 31 Jan 2014 16:00:33 +0100 Subject: [PATCH 1/1] Oh, right --- publishers/__init__.py | 0 publishers/admin.py | 4 ++++ publishers/migrations/0001_initial.py | 34 +++++++++++++++++++++++++++ publishers/migrations/__init__.py | 0 publishers/models.py | 8 +++++++ 5 files changed, 46 insertions(+) create mode 100644 publishers/__init__.py create mode 100644 publishers/admin.py create mode 100644 publishers/migrations/0001_initial.py create mode 100644 publishers/migrations/__init__.py create mode 100644 publishers/models.py diff --git a/publishers/__init__.py b/publishers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/publishers/admin.py b/publishers/admin.py new file mode 100644 index 0000000..5e2cf36 --- /dev/null +++ b/publishers/admin.py @@ -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 index 0000000..1a77507 --- /dev/null +++ b/publishers/migrations/0001_initial.py @@ -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 index 0000000..e69de29 diff --git a/publishers/models.py b/publishers/models.py new file mode 100644 index 0000000..10d1947 --- /dev/null +++ b/publishers/models.py @@ -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 -- 2.20.1