Jasurbek Nabijonov
Jasurbek Nabijonov

Reputation: 1745

How to not reset form values in django admin

I am using Django-admin for inserting data. But when I submit, the form resets values, so I need to insert some of the fields again. Is it possible not to reset some of the field values?enter image description here

Upvotes: 1

Views: 102

Answers (1)

Cem Nisan
Cem Nisan

Reputation: 107

You can set the some initial value in your form's initialized:

models.charField(default="x")

or

models.charField(initial= "x")

Upvotes: 1

Related Questions