Skip to content

Commit

Permalink
Merge pull request #24 from styleseat/django-1.7
Browse files Browse the repository at this point in the history
Django 1.7 breaking changes
  • Loading branch information
jgaren authored Aug 5, 2016
2 parents abee80d + 04a4b76 commit 18e0008
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 109 deletions.
2 changes: 1 addition & 1 deletion examples/demo/products/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.core.urlresolvers import reverse
import django.forms

from satchless.image import IMAGE_SIZES
from satchless.satchless_image import IMAGE_SIZES

from . import models

Expand Down
4 changes: 2 additions & 2 deletions examples/demo/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Django>=1.3
django-grappelli
django-haystack
django-haystack>=1.0,<2.0
django-localeurl
django-mothertongue
git+git://github.com/django-mptt/django-mptt.git#egg=django-mptt
django-pagination
south
whoosh
whoosh==2.4.1
# these need setup.py
git+git://github.com/mirumee/django-payments.git#egg=django-payments
# git+git://github.com/emesik/mamona.git#egg=mamona
11 changes: 4 additions & 7 deletions examples/demo/settings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding:utf-8 -*-
import os
import re
from localeurl.models import patch_reverse
patch_reverse()
from satchless.contrib.pricing.cache import PricingCacheHandler

from django.core.urlresolvers import reverse
Expand Down Expand Up @@ -153,7 +151,6 @@
'satchless.contrib.delivery.simplepost',
'satchless.payment',
'products',
'south',
'pagination',
'core',
'carts',
Expand All @@ -165,7 +162,7 @@
'search.haystack_predictive',
'payments',
'payments.dummy',
'satchless.contrib.payment.django_payments_provider',
#'satchless.contrib.payment.django_payments_provider',
)

SATCHLESS_IMAGE_SIZES = {
Expand Down Expand Up @@ -248,10 +245,10 @@ def get_cache_key(self, *args, **kwargs):

INTERNAL_IPS = ['127.0.0.1']

# http://south.aeracode.org/ticket/520
SOUTH_TESTS_MIGRATE = False

try:
execfile(os.path.join(PROJECT_ROOT, 'local_settings.py'))
except IOError:
pass

from localeurl.models import patch_reverse
patch_reverse()
6 changes: 4 additions & 2 deletions satchless/payment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ def __init__(self, error_message):

class PaymentsGatewayReceiptFormError(PaymentFailure):
def __init__(self, form):
errors = dict(form.errors,
__all__=form.non_form_errors)
error_message = u', '.join(
[u':'.join([key, u', '.join(errors)])
for key, errors in form._errors.iteritems()])
[u':'.join([key, u', '.join(msgs)])
for key, msgs in errors.iteritems()])
super(PaymentsGatewayReceiptFormError, self).__init__(error_message)


Expand Down
121 changes: 25 additions & 96 deletions satchless/payment/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,101 +1,30 @@
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

class Migration(SchemaMigration):
from django.db import models, migrations

def forwards(self, orm):

# Adding model 'PaymentVariant'
db.create_table('payment_paymentvariant', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('subtype_attr', self.gf('django.db.models.fields.CharField')(max_length=500)),
('order', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['order.Order'])),
('name', self.gf('django.db.models.fields.CharField')(max_length=128)),
('description', self.gf('django.db.models.fields.TextField')(blank=True)),
('price', self.gf('django.db.models.fields.DecimalField')(max_digits=12, decimal_places=4)),
('amount', self.gf('django.db.models.fields.DecimalField')(max_digits=12, decimal_places=4)),
))
db.send_create_signal('payment', ['PaymentVariant'])

class Migration(migrations.Migration):

def backwards(self, orm):

# Deleting model 'PaymentVariant'
db.delete_table('payment_paymentvariant')
dependencies = [
('order', '__first__'),
]


models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 23, 23, 48, 16, 704062)'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2014, 8, 23, 23, 48, 16, 703975)'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'order.order': {
'Meta': {'ordering': "('-last_status_change',)", 'object_name': 'Order'},
'billing_city': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'billing_company_name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'billing_country': ('django.db.models.fields.CharField', [], {'max_length': '2', 'blank': 'True'}),
'billing_country_area': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}),
'billing_first_name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'billing_last_name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'billing_phone': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'billing_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
'billing_street_address_1': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'billing_street_address_2': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'billing_tax_id': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
'currency': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_status_change': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
'payment_type': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}),
'status': ('django.db.models.fields.CharField', [], {'default': "'checkout'", 'max_length': '32'}),
'token': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '32', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'orders'", 'null': 'True', 'to': "orm['auth.User']"})
},
'payment.paymentvariant': {
'Meta': {'object_name': 'PaymentVariant'},
'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '4'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'order': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.Order']"}),
'price': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '4'}),
'subtype_attr': ('django.db.models.fields.CharField', [], {'max_length': '500'})
}
}

complete_apps = ['payment']
operations = [
migrations.CreateModel(
name='PaymentVariant',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('subtype_attr', models.CharField(max_length=500, editable=False)),
('name', models.CharField(max_length=128, verbose_name='name')),
('description', models.TextField(verbose_name='description', blank=True)),
('price', models.DecimalField(verbose_name='unit price', max_digits=12, decimal_places=4)),
('amount', models.DecimalField(verbose_name='payment applied', max_digits=12, decimal_places=4)),
('order', models.ForeignKey(to='order.Order')),
],
options={
'abstract': False,
},
bases=(models.Model,),
),
]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
]

REQUIREMENTS = [
'Django>=1.6,<1.7',
'Django>=1.7,<1.8',
'django-mptt>=0.4.2,<0.8.0',
]

Expand Down

0 comments on commit 18e0008

Please sign in to comment.