From: Jan Szejko Date: Mon, 3 Apr 2017 17:05:58 +0000 (+0200) Subject: switch to new migrations X-Git-Tag: 2.0 X-Git-Url: https://git.mdrn.pl/django-sponsors.git/commitdiff_plain/f8094f81cec565352dcd981edf57671bfe0b5b8c?ds=sidebyside;hp=2ca7af849b2be03c9fcf2693396f2c5476579fda switch to new migrations --- diff --git a/setup.py b/setup.py index 5d14690..cc49805 100755 --- a/setup.py +++ b/setup.py @@ -4,10 +4,11 @@ import os.path from setuptools import setup, find_packages + def whole_trees(package_dir, paths): def whole_tree(prefix, path): files = [] - for f in (f for f in os.listdir(os.path.join(prefix, path)) if not f[0]=='.'): + for f in (f for f in os.listdir(os.path.join(prefix, path)) if not f[0] == '.'): new_path = os.path.join(path, f) if os.path.isdir(os.path.join(prefix, new_path)): files.extend(whole_tree(prefix, new_path)) @@ -22,16 +23,16 @@ def whole_trees(package_dir, paths): setup( name='django-sponsors', - version='1.1', + version='2.0', author='Marek Stępniowski', author_email='marek@stepniowski.com', - maintainer='Radek Czajka', - maintainer_email='radoslaw.czajka@nowoczesnapolska.org.pl', - url = '', + maintainer='Jan Szejko', + maintainer_email='jan.szejko@nowoczesnapolska.org.pl', + url='', packages=find_packages(), - package_data={'sponsors': whole_trees('sponsors', - ['templates', 'locale', 'static'])}, + package_data={'sponsors': whole_trees('sponsors', ['templates', 'locale', 'static'])}, license='LICENSE', description='Manage your lists of sponsors with Django admin.', long_description=open('README.md').read(), + install_requires=['jsonfield'], ) diff --git a/sponsors/migrations/0001_initial.py b/sponsors/migrations/0001_initial.py index 6406595..692f9b1 100644 --- a/sponsors/migrations/0001_initial.py +++ b/sponsors/migrations/0001_initial.py @@ -1,60 +1,37 @@ -# encoding: 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 'Sponsor' - db.create_table('sponsors_sponsor', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=120)), - ('_description', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), - ('logo', self.gf('django.db.models.fields.files.ImageField')(max_length=100)), - ('url', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - )) - db.send_create_signal('sponsors', ['Sponsor']) - - # Adding model 'SponsorPage' - db.create_table('sponsors_sponsorpage', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=120)), - ('sponsors', self.gf('jsonfield.fields.JSONField')(default={})), - ('_html', self.gf('django.db.models.fields.TextField')(blank=True)), - ('sprite', self.gf('django.db.models.fields.files.ImageField')(max_length=100, blank=True)), - )) - db.send_create_signal('sponsors', ['SponsorPage']) - - - def backwards(self, orm): - - # Deleting model 'Sponsor' - db.delete_table('sponsors_sponsor') - - # Deleting model 'SponsorPage' - db.delete_table('sponsors_sponsorpage') - - - models = { - 'sponsors.sponsor': { - 'Meta': {'object_name': 'Sponsor'}, - '_description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - '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': '120'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'sponsors.sponsorpage': { - 'Meta': {'object_name': 'SponsorPage'}, - '_html': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'sponsors': ('jsonfield.fields.JSONField', [], {'default': '{}'}), - 'sprite': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}) - } - } - - complete_apps = ['sponsors'] +# -*- coding: utf-8 -*- +# Generated by Django 1.10.6 on 2017-04-03 16:57 +from __future__ import unicode_literals + +from django.db import migrations, models +import jsonfield.fields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Sponsor', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=120, verbose_name='name')), + ('_description', models.CharField(blank=True, max_length=255, verbose_name='description')), + ('logo', models.ImageField(upload_to=b'sponsorzy/sponsor/logo', verbose_name='logo')), + ('url', models.URLField(blank=True, verbose_name='url')), + ], + ), + migrations.CreateModel( + name='SponsorPage', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=120, verbose_name='name')), + ('sponsors', jsonfield.fields.JSONField(default={}, verbose_name='sponsors')), + ('_html', models.TextField(blank=True, editable=False)), + ('sprite', models.ImageField(blank=True, upload_to=b'sponsorzy/sprite')), + ], + ), + ]