Created
October 1, 2020 11:48
-
-
Save gemcave/b8c4af1145c84c36e2fe037793326088 to your computer and use it in GitHub Desktop.
admin form problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Вывести в форме Product в админке, дополнительное поле чтобы заполнить город, не создавая дополнительного поля в модели Product | |
class Product(models.Model): | |
title = models.CharField(max_length=250, verbose_name='Название города') | |
class City(models.Model): | |
name = models.CharField(max_length=250, verbose_name='Название города') | |
products = models.ManyToManyField(Bath, blank=True, verbose_name='Бани', related_name='city') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment