From: Radek Czajka Date: Fri, 31 Jan 2014 15:00:33 +0000 (+0100) Subject: Oh, right X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/8f939c57adbcfa3bb6f2ab9625881495140c4501?ds=sidebyside Oh, right --- 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