Skip to content
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.

Commit

Permalink
Merge branch 'develop', refactored tests, Github #22
Browse files Browse the repository at this point in the history
  • Loading branch information
ionescu77 committed Jun 27, 2016
2 parents 7a0b18a + 50c9559 commit 257b914
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 226 deletions.
2 changes: 2 additions & 0 deletions requirements/razvansky.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ coveralls==1.1
docopt==0.6.2

feedparser==5.2.1

factory_boy==2.7.0
1 change: 1 addition & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ coveralls==1.1
docopt==0.6.2

feedparser==5.2.1
factory_boy==2.7.0
8 changes: 4 additions & 4 deletions src/blogengine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class Category(models.Model):
name = models.CharField(max_length=100)
description = models.TextField()
slug = models.SlugField(max_length=40, unique=True, blank=True, null=True)
def save(self):
def save(self, *args, **kwargs):
if not self.slug:
self.slug = slugify(unicode(self.name))
super(Category, self).save()
super(Category, self).save(*args, **kwargs)
def get_absolute_url(self):
return "/blog/category/%s/" % (self.slug)
def __unicode__(self):
Expand All @@ -22,10 +22,10 @@ class Tag(models.Model):
name = models.CharField(max_length=100)
description = models.TextField()
slug = models.SlugField(max_length=40, unique=True, blank=True, null=True)
def save(self):
def save(self, *args, **kwargs):
if not self.slug:
self.slug = slugify(unicode(self.name))
super(Tag, self).save()
super(Tag, self).save(*args, **kwargs)
def get_absolute_url(self):
return "/blog/tag/%s/" % (self.slug)
def __unicode__(self):
Expand Down
Loading

0 comments on commit 257b914

Please sign in to comment.