Skip to content

Commit

Permalink
Merge branch 'tidying' of github.com:AndrewIngram/django-oscar into t…
Browse files Browse the repository at this point in the history
…idying
  • Loading branch information
Andrew Ingram committed Jun 13, 2011
2 parents 680601c + e7b134e commit 3348cfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 5 additions & 7 deletions oscar/apps/product/abstract_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,18 @@ def save(self, *args, **kwargs):
else:
self.slug = slug
super(AbstractCategory, self).save(*args, **kwargs)

def get_ancestors(self, include_self=True):
ancestors = list(super(AbstractCategory, self).get_ancestors())
if include_self:
ancestors.append(self)
return ancestors

@models.permalink
def get_absolute_url(self):
u"""Return a product's absolute url"""
return ('products:category', (), {
'category_slug': self.slug })



class Meta:
abstract = True
ordering = ['name']
Expand All @@ -84,11 +82,11 @@ class Meta:
class AbstractItemCategory(models.Model):
item = models.ForeignKey('product.Item')
category = models.ForeignKey('product.Category')
canonical = models.BooleanField(default=False, db_index=True)
is_canonical = models.BooleanField(default=False, db_index=True)

class Meta:
abstract = True
ordering = ['-canonical']
ordering = ['-is_canonical']


class AbstractItem(models.Model):
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ pysolr==2.0.13
PyZen==0.3.1
mock==0.7.0
twill==0.9
-e git+https://[email protected]/AndrewIngram/django-extra-views.git#egg=django-extra-views

0 comments on commit 3348cfb

Please sign in to comment.