Форум сайта python.su
Добрый день!
Столкнулся с проблемкой.
кусок из models.py
class Posts(models.Model):
name = models.CharField(max_length=255)
class Meta:
db_table = u'posts'
def __unicode__(self):
return self.name
class Privileges(models.Model):
name = models.CharField(unique=True, max_length=255)
obj = models.ForeignKey(Objects, db_column='id_object')
class Meta:
db_table = u'privileges'
def __unicode__(self):
return self.name
class PostPrivileges(models.Model):
post = models.ForeignKey(Posts, db_column='id_post')
priv = models.ForeignKey(Privileges, db_column='id_priv')
class Meta:
db_table = u'post_privileges'
def __unicode__(self):
return u'%s %s' % (self.post, self.priv)
class PrivilegesForm(forms.ModelForm):
class Meta:
model = PostPrivileges
Офлайн