Re: merge fields from different table

2022-11-04 Thread DUSHYANT SINGH
hello i am not from the py community so please remove me from this section. thanks On Sat, Nov 5, 2022 at 12:06 AM Ammar Mohammed wrote: > *Get your Locations object :* > obj = Locations.objects.get(pk=1) > *Then get the region:* > >

Re: merge fields from different table

2022-11-04 Thread Ammar Mohammed
*Get your Locations object :* obj = Locations.objects.get(pk=1) *Then get the region:* obj.region.region_name On Fri, 4 Nov 2022, 7:29 PM Kala Rani, wrote: > models.py > class Regions(models.Model): > region_name = models.CharField(max_length=255) > > class Locations(models.Model): region =

Merging two fields from different table

2022-11-04 Thread Kala Rani
My models.py class Regions(models.Model): region_name = models.CharField(max_length=255) class Locations(models.Model): region = models.ForeignKey(Regions, on_delete=models.CASCADE,blank=True,null=True) name = models.CharField(max_length=255) How to do this query in django? select

psycopg 3 - getting attributeError

2022-11-04 Thread Brian Nabusiu
[image: attribute_error.png]Hello, I wanted to migrate my app to using psycopg 3. However, I got an error that insists using psycopg2, even when it was not installed in venv. So I decided to ammend some django code as illustrated by the inventor of psycopg3. However, 1. django complained

merge fields from different table

2022-11-04 Thread Kala Rani
models.py class Regions(models.Model): region_name = models.CharField(max_length=255) class Locations(models.Model): region = models.ForeignKey(Regions, on_delete=models.CASCADE,blank=True,null=True) name = models.CharField(max_length=255) How to do this query in django? select

Re: Loop through QuerySet in Django

2022-11-04 Thread Marcelo Robin
I have a problem El jue., 3 nov. 2022 16:40, subin escribió: > Please let me know if that is okay. > > On Wed, Nov 2, 2022 at 5:03 PM Marcelo A. Robin > wrote: > >> I have a processors.py file where I generate a context processor to load >> static data into my project's base template. I have

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