Answer the question
In order to leave comments, you need to log in
How to make compound object names in django admin?
Hello. There are 2 models:
models.py
Tables:
class Tables(models.Model):
number = models.CharField(u"Номер_стола", max_length=100)
...
def __str__(self):
return "%s" % (self.number)
class Orders(models.Model):
tables = models.ForeignKey(Tables, on_delete=models.CASCADE)
date_pub = models.DateTimeField(auto_now_add=True)
...
def __str__(self):
return "%s, %s" % (self.pk, self.date_pub)
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