Browse files

Merge contact model into store model

Fixes #51
  • Loading branch information...
1 parent 25a256e commit 9d8594646fe2df25690c965cd20ab3859cecbfdc @codeinthehole codeinthehole committed Jan 25, 2013
View
10 sandbox/fixtures/stores.json
@@ -145,16 +145,6 @@
},
{
"pk": 1,
- "model": "stores.storecontact",
- "fields": {
- "phone": "(03) 9848 7209",
- "manager_name": "",
- "store": 5,
- "email": "doncaster@dymocks.com.au"
- }
- },
- {
- "pk": 1,
"model": "stores.store",
"fields": {
"group": null,
View
2 sandbox/sandbox/settings.py
@@ -82,7 +82,7 @@
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
- 'debug_toolbar.middleware.DebugToolbarMiddleware',
+# 'debug_toolbar.middleware.DebugToolbarMiddleware',
'oscar.apps.basket.middleware.BasketMiddleware',
)
View
59 stores/abstract_models.py
@@ -45,32 +45,16 @@ def __unicode__(self):
return self.name
-class StoreContact(models.Model):
+class Store(models.Model):
+ name = models.CharField(_('Name'), max_length=100)
+ slug = models.SlugField(_('Slug'), max_length=100, unique=True, null=True)
+
+ # Contact details
manager_name = models.CharField(
_('Manager name'), max_length=200, blank=True, null=True)
phone = models.CharField(_('Phone'), max_length=20, blank=True, null=True)
email = models.CharField(_('Email'), max_length=100, blank=True, null=True)
- store = models.OneToOneField(
- 'stores.Store',
- verbose_name=_("Store"),
- related_name="contact_details")
-
- class Meta:
- abstract = True
-
- def __unicode__(self):
- return "Contact details for %s" % self.store.name
-
- @property
- def is_empty(self):
- return any([self.manage_name, self.phone, self.email])
-
-
-class Store(models.Model):
- name = models.CharField(_('Name'), max_length=100)
- slug = models.SlugField(_('Slug'), max_length=100, unique=True, null=True)
-
reference = models.CharField(
_("Reference"),
max_length=32,
@@ -122,7 +106,8 @@ def get_absolute_url(self):
class OpeningPeriod(models.Model):
PERIOD_FORMAT = _("%(start)s - %(end)s")
- MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY = range(1, 8)
+ (MONDAY, TUESDAY, WEDNESDAY, THURSDAY,
+ FRIDAY, SATURDAY, SUNDAY) = range(1, 8)
WEEK_DAYS = {
MONDAY: _("Monday"),
TUESDAY: _("Tuesday"),
@@ -138,22 +123,19 @@ class OpeningPeriod(models.Model):
weekday_choices = [(k, v) for k, v in WEEK_DAYS.items()]
weekday = models.PositiveIntegerField(
_("Weekday"),
- choices=weekday_choices
- )
+ choices=weekday_choices)
start = models.CharField(
_("Start"),
max_length=30,
null=True,
blank=True,
- help_text=_("Leaving start and end time empty is displayed as 'Closed'")
- )
+ help_text=_("Leaving start and end time empty is displayed as 'Closed'"))
end = models.CharField(
_("End"),
max_length=30,
null=True,
blank=True,
- help_text=_("Leaving start and end time empty is displayed as 'Closed'")
- )
+ help_text=_("Leaving start and end time empty is displayed as 'Closed'"))
@property
def printable_weekday(self):
@@ -179,46 +161,39 @@ class StoreStock(models.Model):
store = models.ForeignKey(
'stores.Store',
verbose_name=_("Store"),
- related_name='stock'
- )
+ related_name='stock')
product = models.ForeignKey(
'catalogue.Product',
verbose_name=_("Product"),
- related_name="store_stock"
- )
+ related_name="store_stock")
# Stock level information
num_in_stock = models.PositiveIntegerField(
_("Number in stock"),
default=0,
blank=True,
- null=True
- )
+ null=True)
# The amount of stock allocated in store but not fed back to the master
num_allocated = models.IntegerField(
_("Number allocated"),
default=0,
blank=True,
- null=True
- )
+ null=True)
location = models.CharField(
_("In store location"),
max_length=50,
blank=True,
- null=True
- )
+ null=True)
# Date information
date_created = models.DateTimeField(
_("Date Created"),
- auto_now_add=True
- )
+ auto_now_add=True)
date_updated = models.DateTimeField(
_("Date Updated"),
auto_now=True,
- db_index=True
- )
+ db_index=True)
class Meta:
abstract = True
View
10 stores/dashboard/views.py
@@ -12,7 +12,6 @@
Store = get_model('stores', 'Store')
StoreGroup = get_model('stores', 'StoreGroup')
-StoreContact = get_model('stores', 'StoreContact')
OpeningPeriod = get_model('stores', 'OpeningPeriod')
StoreAddress = get_model('stores', 'StoreAddress')
@@ -31,13 +30,6 @@ class StoreAddressInline(InlineFormSet):
form_class = forms.StoreAddressForm
-class StoreContactInline(InlineFormSet):
- extra = 1
- max_num = 1
- can_delete = False
- model = StoreContact
-
-
class OpeningPeriodInline(InlineFormSet):
extra = 7
max_num = 7
@@ -46,7 +38,7 @@ class OpeningPeriodInline(InlineFormSet):
class StoreEditMixin(object):
- inlines = [OpeningPeriodInline, StoreAddressInline, StoreContactInline]
+ inlines = [OpeningPeriodInline, StoreAddressInline]
def get_form_kwargs(self):
kwargs = super(StoreEditMixin, self).get_form_kwargs()
View
232 ...migrations/0002_auto__del_storecontact__add_field_store_manager_name__add_field_store_.py
@@ -0,0 +1,232 @@
+# -*- 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):
+ # Deleting model 'StoreContact'
+ db.delete_table('stores_storecontact')
+
+ # Adding field 'Store.manager_name'
+ db.add_column('stores_store', 'manager_name',
+ self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True),
+ keep_default=False)
+
+ # Adding field 'Store.phone'
+ db.add_column('stores_store', 'phone',
+ self.gf('django.db.models.fields.CharField')(max_length=20, null=True, blank=True),
+ keep_default=False)
+
+ # Adding field 'Store.email'
+ db.add_column('stores_store', 'email',
+ self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True),
+ keep_default=False)
+
+
+ def backwards(self, orm):
+ # Adding model 'StoreContact'
+ db.create_table('stores_storecontact', (
+ ('manager_name', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True)),
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('phone', self.gf('django.db.models.fields.CharField')(max_length=20, null=True, blank=True)),
+ ('email', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)),
+ ('store', self.gf('django.db.models.fields.related.OneToOneField')(related_name='contact_details', unique=True, to=orm['stores.Store'])),
+ ))
+ db.send_create_signal('stores', ['StoreContact'])
+
+ # Deleting field 'Store.manager_name'
+ db.delete_column('stores_store', 'manager_name')
+
+ # Deleting field 'Store.phone'
+ db.delete_column('stores_store', 'phone')
+
+ # Deleting field 'Store.email'
+ db.delete_column('stores_store', 'email')
+
+
+ models = {
+ 'address.country': {
+ 'Meta': {'ordering': "('-is_highlighted', 'name')", 'object_name': 'Country'},
+ 'is_highlighted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
+ 'is_shipping_country': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
+ 'iso_3166_1_a2': ('django.db.models.fields.CharField', [], {'max_length': '2', 'primary_key': 'True'}),
+ 'iso_3166_1_a3': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'db_index': 'True'}),
+ 'iso_3166_1_numeric': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'db_index': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'printable_name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
+ },
+ 'catalogue.attributeentity': {
+ 'Meta': {'object_name': 'AttributeEntity'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'blank': 'True'}),
+ 'type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entities'", 'to': "orm['catalogue.AttributeEntityType']"})
+ },
+ 'catalogue.attributeentitytype': {
+ 'Meta': {'object_name': 'AttributeEntityType'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'blank': 'True'})
+ },
+ 'catalogue.attributeoption': {
+ 'Meta': {'object_name': 'AttributeOption'},
+ 'group': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'options'", 'to': "orm['catalogue.AttributeOptionGroup']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'option': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+ },
+ 'catalogue.attributeoptiongroup': {
+ 'Meta': {'object_name': 'AttributeOptionGroup'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
+ },
+ 'catalogue.category': {
+ 'Meta': {'ordering': "['full_name']", 'object_name': 'Category'},
+ 'depth': ('django.db.models.fields.PositiveIntegerField', [], {}),
+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'full_name': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
+ 'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
+ 'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '1024'})
+ },
+ 'catalogue.option': {
+ 'Meta': {'object_name': 'Option'},
+ 'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'type': ('django.db.models.fields.CharField', [], {'default': "'Required'", 'max_length': '128'})
+ },
+ 'catalogue.product': {
+ 'Meta': {'ordering': "['-date_created']", 'object_name': 'Product'},
+ 'attributes': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.ProductAttribute']", 'through': "orm['catalogue.ProductAttributeValue']", 'symmetrical': 'False'}),
+ 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Category']", 'through': "orm['catalogue.ProductCategory']", 'symmetrical': 'False'}),
+ 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_discountable': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'variants'", 'null': 'True', 'to': "orm['catalogue.Product']"}),
+ 'product_class': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductClass']", 'null': 'True'}),
+ 'product_options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'recommended_products': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Product']", 'symmetrical': 'False', 'through': "orm['catalogue.ProductRecommendation']", 'blank': 'True'}),
+ 'related_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'relations'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
+ 'score': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255'}),
+ 'status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'upc': ('django.db.models.fields.CharField', [], {'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'})
+ },
+ 'catalogue.productattribute': {
+ 'Meta': {'ordering': "['code']", 'object_name': 'ProductAttribute'},
+ 'code': ('django.db.models.fields.SlugField', [], {'max_length': '128'}),
+ 'entity_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntityType']", 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'option_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOptionGroup']", 'null': 'True', 'blank': 'True'}),
+ 'product_class': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'attributes'", 'null': 'True', 'to': "orm['catalogue.ProductClass']"}),
+ 'required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'type': ('django.db.models.fields.CharField', [], {'default': "'text'", 'max_length': '20'})
+ },
+ 'catalogue.productattributevalue': {
+ 'Meta': {'object_name': 'ProductAttributeValue'},
+ 'attribute': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductAttribute']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attribute_values'", 'to': "orm['catalogue.Product']"}),
+ 'value_boolean': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'value_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'value_entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntity']", 'null': 'True', 'blank': 'True'}),
+ 'value_float': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
+ 'value_integer': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'value_option': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOption']", 'null': 'True', 'blank': 'True'}),
+ 'value_richtext': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'value_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
+ },
+ 'catalogue.productcategory': {
+ 'Meta': {'ordering': "['-is_canonical']", 'object_name': 'ProductCategory'},
+ 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Category']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_canonical': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
+ 'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
+ },
+ 'catalogue.productclass': {
+ 'Meta': {'ordering': "['name']", 'object_name': 'ProductClass'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'requires_shipping': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128'}),
+ 'track_stock': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
+ },
+ 'catalogue.productrecommendation': {
+ 'Meta': {'object_name': 'ProductRecommendation'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'primary': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'primary_recommendations'", 'to': "orm['catalogue.Product']"}),
+ 'ranking': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
+ 'recommendation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
+ },
+ 'stores.openingperiod': {
+ 'Meta': {'ordering': "['weekday']", 'object_name': 'OpeningPeriod'},
+ 'end': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'start': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'store': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'opening_periods'", 'to': "orm['stores.Store']"}),
+ 'weekday': ('django.db.models.fields.PositiveIntegerField', [], {})
+ },
+ 'stores.store': {
+ 'Meta': {'ordering': "('name',)", 'object_name': 'Store'},
+ 'description': ('django.db.models.fields.CharField', [], {'max_length': '2000', 'null': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'group': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'stores'", 'null': 'True', 'to': "orm['stores.StoreGroup']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_pickup_store': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'location': ('django.contrib.gis.db.models.fields.PointField', [], {}),
+ 'manager_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'phone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
+ 'reference': ('django.db.models.fields.CharField', [], {'max_length': '32', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'unique': 'True', 'null': 'True'})
+ },
+ 'stores.storeaddress': {
+ 'Meta': {'object_name': 'StoreAddress'},
+ 'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['address.Country']"}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+ 'line1': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'line2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'line3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'line4': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'postcode': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
+ 'search_text': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
+ 'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'store': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'address'", 'unique': 'True', 'to': "orm['stores.Store']"}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'})
+ },
+ 'stores.storegroup': {
+ 'Meta': {'object_name': 'StoreGroup'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'})
+ },
+ 'stores.storestock': {
+ 'Meta': {'object_name': 'StoreStock'},
+ 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'location': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+ 'num_allocated': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True', 'blank': 'True'}),
+ 'num_in_stock': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'null': 'True', 'blank': 'True'}),
+ 'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'store_stock'", 'to': "orm['catalogue.Product']"}),
+ 'store': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'stock'", 'to': "orm['stores.Store']"})
+ }
+ }
+
+ complete_apps = ['stores']
View
4 stores/models.py
@@ -9,10 +9,6 @@ class StoreGroup(abstract_models.StoreGroup):
pass
-class StoreContact(abstract_models.StoreContact):
- pass
-
-
class Store(abstract_models.Store):
pass
View
21 stores/templates/stores/dashboard/store_update.html
@@ -46,9 +46,6 @@
<a href="#store_details" data-toggle="tab">Store Details</a>
</li>
<li>
- <a href="#store_contact" data-toggle="tab">Store Contact</a>
- </li>
- <li>
<a href="#store_location" data-toggle="tab">Store Location</a>
</li>
<li>
@@ -82,24 +79,6 @@
{% endfor %}
</div>
</div>
- <div id="store_contact" class="tab-pane">
- <div class="table-header">
- <h3>{% trans "Store contact" %}</h3>
- </div>
- <div class="well well-blank">
- {# we are adding the contact detail inline form here #}
- {% with formset=inlines.2 %}
-
- {{ formset.management_form }}
- {% for contact_form in formset %}
- {% for field in contact_form %}
- {% include "partials/form_field.html" %}
- {% endfor %}
- {% endfor %}
- </div>
- {% endwith %}
-
- </div>
<div id="store_location" class="tab-pane">
<div class="table-header">
<h3>{% trans "Store location" %}</h3>
View
4 stores/templates/stores/detail.html
@@ -7,6 +7,10 @@
<link rel="stylesheet" href="{{ STATIC_URL }}stores/css/stores.css" />
{% endblock %}
+{% block title %}
+{{ store.name }} | {{ block.super }}
+{% endblock %}
+
{% block breadcrumbs %}
<ul class="breadcrumb">
<li>
View
2 tests/stores_tests.py
@@ -84,7 +84,6 @@ def test_can_create_a_new_store_without_opening_periods(self):
create_form['is_pickup_store'] = False
create_form['is_active'] = True
- create_form['contact_details-0-phone'] = '123456789'
page = create_form.submit()
self.assertRedirects(page, reverse('stores-dashboard:store-list'))
@@ -95,7 +94,6 @@ def test_can_create_a_new_store_without_opening_periods(self):
self.assertEquals(store.name, 'Sample Store')
self.assertEquals(store.location.x, 30.203332)
self.assertEquals(store.location.y, 44.33333)
- self.assertEquals(store.contact_details.phone, '123456789')
self.assertEquals(
store.description,
'A short description of the store'

0 comments on commit 9d85946

Please sign in to comment.