How to disable fields except one in a django model while editing the object? -
I have a model with three fields. I have defined it as a modelform, I have written the idea to add, read and delete objects of this model. Now when I edit, I want to enable a field. The user can only edit this field. How to do this
models.py SO and in the documentation, I have decided to create a new model format which does not include other fields in the meta category. I used to use this new model only while editing. This solved my problem. class MyModel (models.Model): field1 = model.origin (DiffModel1, null = false) Field2 = Models.ForeignKey (DiffModel2, null = False) Field3 = models.IntegerField (default = 0, empty = false)
Comments
Post a Comment