Re: Is async class-based view available?

2021-06-09 Thread kazuki
I know this However, I don't know how to use it. How can I use this to create an asynchronous AsyncListView or AsyncTemplateView? 2021年6月9日水曜日 13:28:16 UTC+9 sutharl...@gmail.com: > https://docs.djangoproject.com/en/3.2/topics/async/ > > On Wed, 9 Jun 2021 at 08:11, kazuki wrote: > >> I'm

Re: [DRF] Serializing a field of type choice

2021-06-09 Thread Lalit Suthar
can I see that model field, I don't think any extra configuration is required for it On Thu, 10 Jun 2021 at 04:44, ezequia...@gmail.com wrote: > Hey guys > > Could you help me with a Django Rest Framework question? > > I have a field in my model that has possible input values, so I'm using >

Re: RelatedObjectDoesNotExist: User has no vendor

2021-06-09 Thread Indu Chouhan
Hi , You can also try this. vendor = User.objects.get(pk=request.user.id).vender Thanks, Indu Chouhan On Wednesday, June 9, 2021 at 12:44:14 PM UTC+5:30 gwisum...@gmail.com wrote: > Hi Every one! I 'm looking for help. > > I'm working with a multi vendor website using django. But there is

[DRF] Serializing a field of type choice

2021-06-09 Thread ezequia...@gmail.com
Hey guys Could you help me with a Django Rest Framework question? I have a field in my model that has possible input values, so I'm using the *choices=* attribute in my model. I'm having difficulty serializing the return of this data in drf. Could someone give me a hint on how best to

Re: My first django project works in mylaptop, locally, but not when deployed

2021-06-09 Thread Software, Web Developer
Hello somebody to help me with this On Wed, Jun 9, 2021 at 3:47 AM AliHassanRaza Khan wrote: > You have to install Django first > pip install django > > On Wed, 9 Jun 2021, 1:24 am Douglas Lopez, > wrote: > >> Maybe some body can help on this. >> >> I have a very simple apps ("Hello work").

Re: RelatedObjectDoesNotExist: User has no vendor

2021-06-09 Thread Lalit Suthar
vendor = Vendor.objects.get(created_by=request.user) you have to pick vendor like this On Wed, 9 Jun 2021 at 15:43, GWISU MANYANDA wrote: > thank you Lalit for you respond > I have changed this line > > vendor = request.user.vendor > > to > > user = vendor.created_by > > Now i'm getting this

Re: Absurdly long queries with Postgres 11 during unit tests

2021-06-09 Thread Chetan Ganji
This might help shed more light on the problem. 1. https://pypi.org/project/pytest-django-queries/ 2. Try cProfile https://www.geeksforgeeks.org/profiling-in-python/ Regards, Chetan Ganji +91-900-483-4183 ganji.che...@gmail.com http://ryucoder.in On Tue, Jun 8, 2021 at 1:33 AM Rich

Re: RelatedObjectDoesNotExist: User has no vendor

2021-06-09 Thread GWISU MANYANDA
thank you Lalit for you respond I have changed this line vendor = request.user.vendor to user = vendor.created_by Now i'm getting this error NameError at /maduka/vendor_admin/ name 'vendor' is not defined On Wed, Jun 9, 2021 at 11:10 AM Lalit Suthar wrote: > coming because of `vendor =

Re: RelatedObjectDoesNotExist: User has no vendor

2021-06-09 Thread Lalit Suthar
coming because of `vendor = request.user.vendor` you have attached user to vendor so you can access user from vendor by doing `user = vendor.created_by` but you can not access vendor from user On Wed, 9 Jun 2021 at 12:43, GWISU MANYANDA wrote: > Hi Every one! I 'm looking for help. > > I'm

RelatedObjectDoesNotExist: User has no vendor

2021-06-09 Thread GWISU MANYANDA
Hi Every one! I 'm looking for help. I'm working with a multi vendor website using django. But there is an issue that I have vendor object vendor but it says User has no vendor. Why is this happening and how may I solve this? *MY model* from django.contrib.auth.models import Userfrom django.db

Re: DEFAULT Django Session is still using File in /tmp (Can't read from directory)

2021-06-09 Thread Andre Foote
Because this is all coming from when I enabled sessions and the server admin tried to implement the application on multiple nodes. On Wednesday, April 28, 2021 at 6:41:24 PM UTC+7 Ryan Nowakowski wrote: > What makes you think this has anything to do with Django sessions? > > > On April 27, 2021