Answer the question
In order to leave comments, you need to log in
Django returning an object from a brace?
models.py
class New(models.Model):
...
category_id = models.ForeignKey(TourCategory, verbose_name="Категория тура", related_name="tour_category")
<select id="id_category_id" name="category_id">
<option value="" selected="selected">---------</option>
<option value="1">TourCategory object</option>
<option value="2">TourCategory object</option>
<option value="3">TourCategory object</option>
</select>
list_select_related = ('tour_category', 'name')
def get_list_select_related(self, request):
return self.list_select_related
Answer the question
In order to leave comments, you need to log in
class TourCategory(models.Model):
name = models.CharField(max_length=200, verbose_name="Имя")
def __str__(self):
return self.name
is this output to custom admin panel or native django admin panel?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question