X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/0f1d9c82677e949f5333447343ae72f45d4841be..4636545e1fcf56506512ec8f136e32aae29641b2:/wolnelektury/migrations/getpaid/0001_initial.py diff --git a/wolnelektury/migrations/getpaid/0001_initial.py b/wolnelektury/migrations/getpaid/0001_initial.py index a4a528004..2ab2d3f64 100644 --- a/wolnelektury/migrations/getpaid/0001_initial.py +++ b/wolnelektury/migrations/getpaid/0001_initial.py @@ -1,104 +1,37 @@ # -*- 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 'Payment' - db.create_table(u'getpaid_payment', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('amount', self.gf('django.db.models.fields.DecimalField')(max_digits=20, decimal_places=4)), - ('currency', self.gf('django.db.models.fields.CharField')(max_length=3)), - ('status', self.gf('django.db.models.fields.CharField')(default='new', max_length=20, db_index=True)), - ('backend', self.gf('django.db.models.fields.CharField')(max_length=50)), - ('created_on', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), - ('paid_on', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, db_index=True, blank=True)), - ('amount_paid', self.gf('django.db.models.fields.DecimalField')(default=0, max_digits=20, decimal_places=4)), - ('order', self.gf('django.db.models.fields.related.ForeignKey')(related_name='payment', to=orm['funding.Funding'])), - )) - db.send_create_signal(u'getpaid', ['Payment']) - - - def backwards(self, orm): - # Deleting model 'Payment' - db.delete_table(u'getpaid_payment') - - - models = { - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}), - 'cover': ('catalogue.fields.EbookField', [], {'max_length': '100', 'null': 'True', 'format_name': "'cover'", 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'epub'", 'blank': 'True'}), - 'extra_info': ('jsonfield.fields.JSONField', [], {'default': "'{}'"}), - 'fb2_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'fb2'", 'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'html'", 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'mobi'", 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'pdf'", 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'txt'", 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'xml'", 'blank': 'True'}) - }, - u'funding.funding': { - 'Meta': {'ordering': "['-payed_at']", 'object_name': 'Funding'}, - 'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}), - 'anonymous': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '127', 'blank': 'True'}), - 'offer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['funding.Offer']"}), - 'payed_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'perks': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['funding.Perk']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'funding.offer': { - 'Meta': {'ordering': "['-end']", 'object_name': 'Offer'}, - 'author': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Book']", 'null': 'True', 'blank': 'True'}), - 'due': ('django.db.models.fields.DateField', [], {}), - 'end': ('django.db.models.fields.DateField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'redakcja_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'start': ('django.db.models.fields.DateField', [], {}), - 'target': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - u'funding.perk': { - 'Meta': {'ordering': "['-price']", 'object_name': 'Perk'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'offer': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['funding.Offer']", 'null': 'True', 'blank': 'True'}), - 'price': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}) - }, - u'getpaid.payment': { - 'Meta': {'ordering': "('-created_on',)", 'object_name': 'Payment'}, - 'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '4'}), - 'amount_paid': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '20', 'decimal_places': '4'}), - 'backend': ('django.db.models.fields.CharField', [], {'max_length': '50'}), - 'created_on': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'currency': ('django.db.models.fields.CharField', [], {'max_length': '3'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'payment'", 'to': u"orm['funding.Funding']"}), - 'paid_on': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), - 'status': ('django.db.models.fields.CharField', [], {'default': "'new'", 'max_length': '20', 'db_index': 'True'}) - } - } - - complete_apps = ['getpaid'] \ No newline at end of file +from __future__ import unicode_literals + +from django.db import models, migrations +import getpaid.abstract_mixin + + +class Migration(migrations.Migration): + + dependencies = [ + ('funding', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Payment', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('amount', models.DecimalField(verbose_name='amount', max_digits=20, decimal_places=4)), + ('currency', models.CharField(max_length=3, verbose_name='currency')), + ('status', models.CharField(default=b'new', max_length=20, verbose_name='status', db_index=True, choices=[(b'new', 'new'), (b'in_progress', 'in progress'), (b'partially_paid', 'partially paid'), (b'paid', 'paid'), (b'failed', 'failed')])), + ('backend', models.CharField(max_length=50, verbose_name='backend')), + ('created_on', models.DateTimeField(auto_now_add=True, verbose_name='created on', db_index=True)), + ('paid_on', models.DateTimeField(default=None, null=True, verbose_name='paid on', db_index=True, blank=True)), + ('amount_paid', models.DecimalField(default=0, verbose_name='amount paid', max_digits=20, decimal_places=4)), + ('external_id', models.CharField(max_length=64, null=True, verbose_name='external id', blank=True)), + ('description', models.CharField(max_length=128, null=True, verbose_name='Description', blank=True)), + ('order', models.ForeignKey(related_name=b'payment', to='funding.Funding')), + ], + options={ + 'ordering': ('-created_on',), + 'verbose_name': 'Payment', + 'verbose_name_plural': 'Payments', + }, + bases=(models.Model, getpaid.abstract_mixin.AbstractMixin), + ), + ]