Answer the question
In order to leave comments, you need to log in
What is the best way to create a form in Django?
there is this model:
class Category(models.Model):
name = models.CharField(u"Название категории", max_length=100)
def __unicode__(self):
return self.name
class Chat(models.Model):
category = models.ForeignKey(Category, name="category", verbose_name=u"Категория")
user = models.ForeignKey(User, name="user", verbose_name=u"Пользователь")
date = models.DateTimeField(u"Дата создания", auto_now_add=True)
objects = TicketManager()
class ChatMessages(models.Model):
ticket = models.ForeignKey(Chat, related_name="messages")
text = models.TextField(u"Сообщение")
user = models.ForeignKey(User)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question