Answer the question
In order to leave comments, you need to log in
How to create a model where the fields will be another model and its field?
Friends, the task is as follows:
I need to map another model and field to a text field.
class TextTemplateField(models.Model):
text_template = models.CharField(max_length=64, unique=True)
model_name = ???
field_name = ???
class SupplierGroup(models.Model):
name = models.CharField(max_length=32, unique=True)
class Supplier(models.Model):
name = models.CharField(max_length=512)
short_name = models.CharField(max_length=100, unique=True)
official_short_name = models.CharField(max_length=100, blank=True)
inn = models.CharField(max_length=12, blank=True)
kpp = models.CharField(max_length=9, blank=True)
ogrn = models.CharField(max_length=15, blank=True)
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