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 class MyModel (models.Model): field1 = model.origin (DiffModel1, null = false) Field2 = Models.ForeignKey (DiffModel2, null = False) Field3 = models.IntegerField (default = 0, empty = false)

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.

Comments

Popular posts from this blog

jasper reports - How to center align barcode using jasperreports and barcode4j -

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -