Trouble with Select_for_update. Postgresql

2021-03-29 Thread zidan....@gmail.com
Hi there . code is as follows: ` models.Classroom table have just one record. # THREAD 1 school_classrooms = models.Classroom.objects.select_for_update().all() with transaction.atomic(): list(school_classrooms) time.sleep(10) # THREAD 2 classroom = models.Classroom.objects.first() classroom.name =

How To Impliment Wishlist in Django eCommerce Without Session

2021-03-29 Thread iamparv...@gmail.com
Hello All, i am new to Django and i want to implement wish-list in eCommerce website. Let me know if any relevant and easy Tutorial or YouTube Video. so i can implement easily and got understand properly wish-list concept. Thanks Regards Kabir -- You received this message because you are sub

Hello mates

2021-03-29 Thread frank galan
Im catching a model in a select, using ajax to request, so Im receiving an error I can,t solve Im get an empty dict, the error is : error: "'str' object has no attribute 'toJSON'". Its occurrs when I try to print the data in console I created a function into the model to convert this in dict, la

Re: django

2021-03-29 Thread Fabio C. Barrionuevo da Luz
Your implementation can probably be changed to something like this import random all_qs = Trending.objects.all() if all_qs.exists(): # checks whether to return at least one record # query all pk numbers and convert to a tuple all_pks = tuple(all_qs.values_list("pk", flat=True)) # g

django

2021-03-29 Thread Jonathan Bilesi
hi i getting this error ValueError at /empty range for randrange() (0, 0, 0) here my code random_object = Trending.objects.all()[randint(0, len(trending) -1)] -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this gro

django-versatileimagefield and Django 3.1/3.2 compatibility

2021-03-29 Thread Fabio C. Barrionuevo da Luz
Hello community >From the point of view of those who develop pluggable apps for Django, do you know if there has been any significant change in ImageField / FileField implementation (and related code) between Django 3.0 and 3.1 and which is not explicitly mentioned in the release notes and maybe p

Re: How to run an already built django project with docker?

2021-03-29 Thread DJANGO DEVELOPER
okay, thanks On Mon, Mar 29, 2021 at 3:45 PM Kunal Solanke wrote: > Again depends on deploy startegy and but the actual deploy won't be > affected while you are working on your local machine with code cloned from > some version control > > On Mon, Mar 29, 2021, 12:38 DJANGO DEVELOPER > wrote: >

Re: File Input from User

2021-03-29 Thread Ryan Nowakowski
On Thu, Mar 18, 2021 at 11:37:08PM -0700, Kumar Gaurav wrote: > I have a social media kind of portal in Django where user can post an image > and write something. > Earlier for image , I used input type=file so that user can select image > from there system . But for my requirement, now I want th

Re: How to run an already built django project with docker?

2021-03-29 Thread Kunal Solanke
Again depends on deploy startegy and but the actual deploy won't be affected while you are working on your local machine with code cloned from some version control On Mon, Mar 29, 2021, 12:38 DJANGO DEVELOPER wrote: > means deploying it on AWS still will not be affected? > > On Mon, Mar 29, 2021

How to properly document and test models with natural keys

2021-03-29 Thread Olivier
Hello, I'm thinking about adding natural keys to a lot of existing models (Djano 3.1.7) to help initializing dev or prod database. 1. How best to unit test models using natural keys ? I was thinking of separately testing both serialization and deserialization but would be very curious to lear

Django Admin 3.1.7: getting RelatedObjectDoesNotExist for required ForeignKey

2021-03-29 Thread Olivier
Hello, I'm using Django 3.1.7's Admin form of the following model: class EthernetInterface(models.Model): slug_name = models.CharField(max_length=32) MAC = MACAddressField(blank=True, null=True) lan = models.ForeignKey(LAN, on_delete=models.PROTECT, related_name='lan_interfaces')

Re: How to run an already built django project with docker?

2021-03-29 Thread DJANGO DEVELOPER
means deploying it on AWS still will not be affected? On Mon, Mar 29, 2021 at 12:07 PM DJANGO DEVELOPER wrote: > oh great. so it will not affect the containerised project. right? > > On Mon, Mar 29, 2021 at 12:03 PM Kunal Solanke > wrote: > >> Yeah its possible to run the project just not insid

Re: How to run an already built django project with docker?

2021-03-29 Thread DJANGO DEVELOPER
oh great. so it will not affect the containerised project. right? On Mon, Mar 29, 2021 at 12:03 PM Kunal Solanke wrote: > Yeah its possible to run the project just not inside a container then, you > will have to run simply outside the container on main host. > Simply with python manage.py runser

Re: How to run an already built django project with docker?

2021-03-29 Thread Kunal Solanke
Yeah its possible to run the project just not inside a container then, you will have to run simply outside the container on main host. Simply with python manage.py runserver😂😂 On Mon, Mar 29, 2021, 12:21 DJANGO DEVELOPER wrote: > I want to ask another question. please ignore my ignorance. > wha