Implemented mandant based blog posts
This commit is contained in:
@@ -123,7 +123,6 @@ class Post(models.Model):
|
||||
published = models.BooleanField(default=True)
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
author = models.ForeignKey(User)
|
||||
mandant = models.ForeignKey(Mandant)
|
||||
|
||||
class Meta:
|
||||
ordering = ['-created']
|
||||
@@ -131,4 +130,12 @@ class Post(models.Model):
|
||||
def __unicode__(self):
|
||||
return u'%s' % self.created
|
||||
|
||||
class RelPostMandant(models.Model):
|
||||
post = models.ForeignKey(Post)
|
||||
mandant = models.ForeignKey(Mandant)
|
||||
|
||||
class Meta:
|
||||
unique_together = ("post", "mandant")
|
||||
def __unicode__(self):
|
||||
return (str(self.post) + " -> " + str(self.mandant))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user