Re: How to use choices in model field

2022-11-04 Thread Aaryan R Soni
Thanks, that worked, Thanks for your help On Wed, Nov 2, 2022, 9:57 PM Julio Cojom wrote: > When you change the status to Verified, you are only changing the object > instance in memory, to save it to the database, you need to call the method > save. > > verification.save() at the end should

Re: How to use choices in model field

2022-11-02 Thread kateregga julius
Follow exactly what he has told you On Wed, Nov 2, 2022, 7:27 PM Julio Cojom wrote: > When you change the status to Verified, you are only changing the object > instance in memory, to save it to the database, you need to call the method > save. > > verification.save() at the end should make it

Re: How to use choices in model field

2022-11-02 Thread Lloyd Leckenby
Class user_stutus? > On Nov 2, 2022, at 9:22 AM, Aaryan R Soni wrote: > > Okay, but still the problem is that how do I set the value of status field, > as I have written in the code, verification.status = 'Verified' it is not > giving any error but it is not working either > > On Wed, Nov 2,

Re: How to use choices in model field

2022-11-02 Thread kateregga julius
Apply a CRUD for updating the status Wait I will send you the updated code in 30 minutes On Wed, Nov 2, 2022, 7:23 PM Aaryan R Soni wrote: > Okay, but still the problem is that how do I set the value of status > field, as I have written in the code, verification.status = 'Verified' it > is not

Re: How to use choices in model field

2022-11-02 Thread Julio Cojom
When you change the status to Verified, you are only changing the object instance in memory, to save it to the database, you need to call the method save. verification.save() at the end should make it work El El miƩ, 2 de nov. de 2022 a la(s) 10:23, Aaryan R Soni < aaryanrson...@gnu.ac.in>

Re: How to use choices in model field

2022-11-02 Thread Aaryan R Soni
Okay, but still the problem is that how do I set the value of status field, as I have written in the code, verification.status = 'Verified' it is not giving any error but it is not working either On Wed, Nov 2, 2022, 9:51 PM kateregga julius wrote: > Don't use square blackest [ ] > >

Re: How to use choices in model field

2022-11-02 Thread kateregga julius
Don't use square blackest [ ] status_choices=(('Unverified','Unverified'),('Verified','Verified')) On Wed, Nov 2, 2022, 5:52 PM Aaryan R Soni wrote: > Hey guys, i am facing some issues using choices in models.CharField. I am > creating a model which has username and status, where status is my

How to use choices in model field

2022-11-02 Thread Aaryan R Soni
Hey guys, i am facing some issues using choices in models.CharField. I am creating a model which has username and status, where status is my choice field. it has 2 values, 'Unverified' and 'Verified'. class user_stutus(models.Model):