Implemented mandant based blog posts

This commit is contained in:
2016-06-17 22:37:43 +02:00
parent e3ef06a41a
commit c2eede9500
5 changed files with 93 additions and 53 deletions

View File

@@ -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))