S
S
Sergey Protasov2019-07-22 13:15:58
Django
Sergey Protasov, 2019-07-22 13:15:58

What is the easiest way to make it possible to fill in the field when creating a model instance, but not to change it when editing?

class AbstractLicense(models.Model):
    group = models.ForeignKey(RNGroup, models.CASCADE, verbose_name=_('Разрешение'))
    ...

those. when creating a "license", we can select a group, but we cannot change it when editing...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Shatalov, 2019-07-22
@netpastor

Edit through the model form and put this ridonly field there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question