Re: Form errors in ListFormsetView created by adding methods to a ListView.

2021-06-11 Thread Lalit Suthar
> > possibly you are requesting with the same pan id again > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To

Re: Working with forms

2021-06-15 Thread Lalit Suthar
you can try if it can be done with widgets I am not sure https://docs.djangoproject.com/en/2.2/ref/forms/widgets/ On Tue, 15 Jun 2021 at 11:24, Williams Andy Inc wrote: > I would like to know is there any easier way rather than overriding super, > how do i add icons into the html input eg to

Re: Support for moving a model between two Django apps #24686

2021-06-07 Thread Lalit Suthar
It does look long and weird but we hardly visit /admin since we do most of the operations from python manage.py shell On Fri, 4 Jun 2021 at 11:42, Mike Dewhirst wrote: > On 4/06/2021 2:28 pm, lalit suthar wrote: > > We had a similar problem and we resolved it by moving all t

Re: ValueError

2021-06-08 Thread Lalit Suthar
https://stackoverflow.com/questions/26829435/collectstatic-command-fails-when-whitenoise-is-enabled On Wed, 9 Jun 2021 at 01:55, Lloyd Mawira wrote: > I am getting this error after running python manage.py collectstatic. > Someone help please. > > ValueError: The file

Re: Is async class-based view available?

2021-06-08 Thread Lalit Suthar
https://docs.djangoproject.com/en/3.2/topics/async/ On Wed, 9 Jun 2021 at 08:11, kazuki wrote: > I'm already using a web application that takes advantage of class-based > views. And I want to take advantage of the async class-based view. > However, I can't find any information when I look it

Re: RelatedObjectDoesNotExist: User has no vendor

2021-06-09 Thread Lalit Suthar
d_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 = request.user.vendor` >> you have attached u

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

Re: Newbie question

2021-06-07 Thread Lalit Suthar
try form.save(commit=False) On Mon, 7 Jun 2021 at 22:10, Moose Smith <47kanga...@gmail.com> wrote: > I have a table which holds simple data like addresses. Created a form > which displays the records in the form and allows the user to select a > record "address" to edit. > > I want this edit

Re: Drop down dependent of more than 2 drop downs

2021-06-07 Thread Lalit Suthar
Hi how did you implemented the first couple of drop downs and what problem you are facing in the third one exactly On Mon, Jun 7, 2021, 1:02 PM Eugene TUYIZERE wrote: > Hello team, > > Am having trouble implementing drop down dependent on more than 2 drop > downs. I successfully did for two

Re: Support for moving a model between two Django apps #24686

2021-06-07 Thread Lalit Suthar
m one app to another. > > Ticket #24686 looks brilliant and might be implemented in the dev version > of Django. > > Maybe I'll give it a try. > > Cheers > > Mike > > -- > (Unsigned mail from my phone) > > Original message > From: Lalit Sutha

Re: Is async class-based view available?

2021-06-10 Thread Lalit Suthar
these are some resource available which can help you https://www.youtube.com/watch?v=19Uh_PA_8Rc https://testdriven.io/blog/django-async-views/ On Thu, 10 Jun 2021 at 10:27, kazuki wrote: > I know this However, I don't know how to use it. > How can I use this to create an asynchronous

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: django cron Job Functionality

2021-06-12 Thread Lalit Suthar
https://medium.com/@yedjoe/celery-4-periodic-task-in-django-9f6b5a8c21c7 http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html http://docs.celeryproject.org/en/latest/userguide/index.html#guide https://www.agiliq.com/blog/2015/07/getting-started-with-celery-and-redis/ On

Re: Using ORM to retrieve values (REAL) from SQLite database to round to 2 decimal places

2021-06-19 Thread Lalit Suthar
this can help https://docs.djangoproject.com/en/2.2/ref/models/database-functions/#round On Fri, 18 Jun 2021 at 22:43, Wai Yeung wrote: > Hello, > > To be able to get a REAL value from a SQLite database rounded to 2 decimal > places, I had to use the following RAW SQL query: > > SELECT >

Re: struck at gettiing each product urls from addidas website

2021-06-21 Thread Lalit Suthar
print(links) outside for loop. Even then if nothing prints means your `listings` is empty On Tue, 22 Jun 2021 at 08:51, ram manoj Vuyyuru wrote: > HI > help me for getting urls for each product > import pandas as pd > import requests > from bs4 import BeautifulSoup as bs > > > url =

Re: Using ORM to retrieve values (REAL) from SQLite database to round to 2 decimal places

2021-06-21 Thread Lalit Suthar
2 > decimal places as some values have a '0' in the second decimal place (i.e. > "2.10" would be "2.1" > > To address the search portion, the search values for any search value that > had trailing zeroes were modified. So if the search was for "2.10&quo

Re: Django chart using chart.js

2021-06-18 Thread Lalit Suthar
this has a good explanation https://www.youtube.com/watch?v=B4Vmm3yZPgc On Fri, 18 Jun 2021 at 19:57, Eugene TUYIZERE wrote: > > > On Thu, 17 Jun 2021 at 11:15, Eugene TUYIZERE > wrote: > >> Team, >> >> I have a table called Indicators. This includes indicator, target and >> progress. Both

Re: Need guidance

2021-05-20 Thread lalit suthar
postgres ArrayField will be suitable for your requirement. Serialization will work the same like it works for other fields. On Thursday, 20 May 2021 at 21:00:14 UTC+5:30 xaadx...@gmail.com wrote: > I wanna to store multiple value in django model using DRF e.g. i have to > choose three days from

Re: help on autologging users after signup

2021-05-25 Thread lalit suthar
request.data.get('password') >> new_user = authenticate(request, email, password) >> request.data contains the username and password >> >> On Monday, May 24, 2021 at 9:29:33 AM UTC+3 tosina...@gmail.com wrote: >> >>> I've tried that it didn't wrk >>>

Re: Announcing DjHTML: A Django template indender

2021-05-24 Thread lalit suthar
This is looking pretty cool! On Monday, 24 May 2021 at 18:54:12 UTC+5:30 Jaap Joris Vens wrote: > Dear all, > > I would like to take this opportunity to announce my side project to > the Django community. It's a Django template indenter called DjHTML. > It's Black for Django templates! > >

Re: I was all new to django.could anyone helpme out with that.

2021-05-26 Thread lalit suthar
In no particular order these 3 resources helped me - https://tutorial.djangogirls.org/en/ - https://docs.djangoproject.com/en/2.2/intro/tutorial01/ - https://www.youtube.com/playlist?list=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW On Wednesday, 26 May 2021 at

Re: Hi all, i'm using 2 modelforms in one view function one as foreign key but when i submit babyform2 not storing in database. anyone please fix this

2021-06-01 Thread Lalit Suthar
because you're passing commit=False with form2 On Tue, 1 Jun 2021 at 14:10, Hugh Frost wrote: > def detail(request): > if request.method == 'POST': > baby_form1 = BabyForm1(data=request.POST) > baby_form2 = BabyForm2(data=request.POST) > > if baby_form1.is_valid()

Re: help on autologging users after signup

2021-05-23 Thread lalit suthar
in authenticate function take values from request.data dictionary email = request.data.get('email') poassword = request.data.get('password') On Sunday, 23 May 2021 at 07:27:51 UTC+5:30 tosina...@gmail.com wrote: > halo guys, i wan make it possible for user to auto login user after > signup in

Re: CSS not linking with HTML

2021-05-29 Thread lalit suthar
1 UTC+5:30 sukhy.g...@gmail.com wrote: > Yes Sir,There was no mistake in code. Code problem was only in mail > content actually code was correct as instruction given by Aniket Sir > > Regards > > > On Sat, May 29, 2021, 13:14 lalit suthar >> have you checked Aniket's answer?

Re: CSS not linking with HTML

2021-05-29 Thread lalit suthar
have you checked Aniket's answer? On Saturday, 29 May 2021 at 11:09:07 UTC+5:30 sukhy.g...@gmail.com wrote: > Done Sir, but not working > > On Sat, May 29, 2021, 10:50 Venu Gopal >> In Firefox Goto Preferences ---> Choose Privacy and Security ---> >> scroll down until you get cookies and

Re: use of annotate in django query

2021-06-02 Thread Lalit Suthar
> in brief, I want to transform this query in django query this will be equivalent to this query in django Customer_Requests.objects.values("arrival_date").annotate(num_req=Count("request_name")) On Thu, 3 Jun 2021 at 02:02, Eugene TUYIZERE wrote: > in brief, I want to transform this query in

Re: use of annotate in django query

2021-06-05 Thread Lalit Suthar
just replied to your mail On Sat, 5 Jun 2021 at 11:48, Eugene TUYIZERE wrote: > Dear Suthar, > > Can I have your private contact? > > regards, > > On Fri, 4 Jun 2021 at 06:25, Lalit Suthar > wrote: > >> my pleasure :) >> >> On Thu, 3 Jun 2021 at

Re: use of annotate in django query

2021-06-03 Thread lalit suthar
> Customer_Requests.objects.all()[-30] > > On Thu, Jun 3, 2021 at 10:51 AM Eugene TUYIZERE > wrote: > >> Dear Latit, >> >> Thank you very much. Now how can I display 30 last records? Regardless of >> how many records I may have ! Just the last 30 records

Re: use of annotate in django query

2021-06-03 Thread lalit suthar
ta': sumdata, > 'color': 'green' > } > chart3 = { > 'chart': {'type': 'column'}, > 'title': {'text': 'Previous statistics'}, > 'xAxis': {'datesb': datesb}, > 'series': [arriva_days] > } > dump3 = json.dumps(chart3) > return render(request,'summarizedchar

Re: use of annotate in django query

2021-06-03 Thread Lalit Suthar
cls=DjangoJSONEncoder) > return render(request,'summarizedchart.html',{'chart': dump}) > > > On Thu, 3 Jun 2021 at 13:27, lalit suthar > wrote: > >> Hi there! >> make these couple of changes >> >> 1) from django.core.serializers.json import DjangoJ

Re: use of annotate in django query

2021-06-03 Thread Lalit Suthar
td['arrival_date']) >>> sumdata.append(listd['num_req']) >>> arriva_days = { >>> 'name': 'Datess', >>> 'data': sumdata, >>> 'color': 'green' >>> } >>> chart = { >>> 'chart': {'type': 'column'}, >>> 'title': {'text':

Re: use of annotate in django query

2021-06-03 Thread Lalit Suthar
my pleasure :) On Thu, 3 Jun 2021 at 20:28, Eugene TUYIZERE wrote: > Dear Suthar, > > Thank you very much. It works well. > > > On Thu, 3 Jun 2021 at 16:48, Lalit Suthar > wrote: > >> not sure but maybe this can work inside views replace >> chart =

Re: Support for moving a model between two Django apps #24686

2021-06-03 Thread lalit suthar
We had a similar problem and we resolved it by moving all the models into a separate internal python package. We can have a separate app in our django project also for writing models only and all other apps import models from there. On Friday, 4 June 2021 at 06:07:53 UTC+5:30 Mike Dewhirst

Re: Django Help | Counting word frequency in Django using dictionary.

2021-07-07 Thread Lalit Suthar
you can try moving to postgres if possible On Wed, 7 Jul 2021 at 10:28, DJANGO DEVELOPER wrote: > I am using sqlite3. so only needs to store the data in django > admin/database but in the form of dictionary or in the form of counted > words. > > On Wed, Jul 7, 2021 at 9:09

Re: ProgrammingError - relationship does not exist

2021-07-07 Thread Lalit Suthar
If this is your personal project delete all migrations inside shops app and run makemigrations, migrate again Not sure but this may work I had similar error some time ago On Wed, 7 Jul 2021 at 14:19, Stathis Angelou wrote: > Good morning Jacob and thank you for your reply, i really do

Re: Django beginner

2021-07-04 Thread Lalit Suthar
I followed these 2 https://www.youtube.com/playlist?list=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW https://docs.djangoproject.com/en/2.2/intro/tutorial01/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: i am trying to learn django from django documentation but i am getting an error message in the first part of the documentation

2021-07-04 Thread Lalit Suthar
rewrite polls/urls.py like below path(''", views.index, name='index'), On Fri, 25 Jun 2021 at 18:59, Symaxx wrote: > I started learning Django from the documentation but it was very hard for > me and it took me a very long time to grasp the concept > > I suggest you try using books by w.s

Re: Role based Authentication

2021-07-07 Thread Lalit Suthar
you can extend User model and have a role field in default User model https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html On Wed, 7 Jul 2021 at 20:47, Avi shah wrote: > https://github.com/Avishah123/Multi-user-auth1 > > On Wed, Jul 7, 2021 at 8:16 PM

Re: i have a picture field in my model that was not stored properly in django database and i can't retrive that picture

2021-07-07 Thread Lalit Suthar
this can help https://simpleisbetterthancomplex.com/tutorial/2016/08/01/how-to-upload-files-with-django.html On Wed, 7 Jul 2021 at 20:25, DJANGO DEVELOPER wrote: > you're doing well but it is not the right way o ask the question. you need > to describe all of your problem and what you have done

Re: ProgrammingError - relationship does not exist

2021-07-08 Thread Lalit Suthar
you can try this https://stackoverflow.com/questions/26283159/django-1-7-migrations-how-do-i-clear-all-migrations-and-start-over-from-scrat#comment41239691_26283159 if that also doesn't work and you are working on a personal project then you can try deleting your db, migration files and re running

Re: paginate_by attribute not giving error.

2021-07-02 Thread Lalit Suthar
override `get_context_data` instead of `get_queryset` for this task refer: https://ccbv.co.uk/ On Thu, 1 Jul 2021 at 14:41, sunday honesty wrote: > Hello guys, it's been a while here. > > Need some help pls. > > I had to override my ListView get_querryset() method to query my posts > according

Re: code question

2021-06-29 Thread Lalit Suthar
https://youtu.be/SNXn76SI1Ks try this On Wed, Jun 30, 2021, 1:27 AM frank dilorenzo wrote: > Here is a function view: > > def base(request): > > shipments = Shipment.objects.all().order_by("-slabel")[:5] > > suppliers = Supplier.objects.all() > > > context = { > >

Re: counting the same words within a song added by a user using Django

2021-07-05 Thread Lalit Suthar
https://www.guru99.com/python-counter-collections-example.html Counter can be helpful for this situation On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER wrote: > Hi there. > I am developing a project based on adding songs to the user's library and > to the home page. > other users can also

Re: counting the same words within a song added by a user using Django

2021-07-06 Thread lalit suthar
cool :D On Tuesday, 6 July 2021 at 10:25:06 UTC+5:30 abubak...@gmail.com wrote: > I found this as well. and I think I want the result this way. > > On Tue, Jul 6, 2021 at 9:21 AM Lalit Suthar wrote: > >> [image: Screen Shot 2021-07-06 at 9.50.12 AM.png] >> Count

Re: counting the same words within a song added by a user using Django

2021-07-05 Thread Lalit Suthar
TC-4, abubak...@gmail.com a écrit : >> >>> Thank you Lalit bhai. >>> it seems to be a solution. >>> but what if I want to get the result for each single word rather than >>> single letter? >>> >>> >>> On Mon, Jul 5, 2021 at 5:43 PM L

Re: Django Help | Counting word frequency in Django using dictionary.

2021-07-06 Thread Lalit Suthar
you can use postgres JsonField https://docs.djangoproject.com/en/3.2/ref/contrib/postgres/fields/#jsonfield On Wed, 7 Jul 2021 at 06:05, DJANGO DEVELOPER wrote: > Hi > I am developing a django project and I want to count word frequency at > the django admin side. > Means a word is repeating in

Re: Role And Permission

2021-08-23 Thread Lalit Suthar
https://medium.com/djangotube/django-roles-groups-and-permissions-introduction-a54d1070544 On Wed, 18 Aug 2021 at 18:32, Premkumar Chalmeti < premkumarchalm...@gmail.com> wrote: > I was working on a similar requirement. > > Checkout this https://github.com/premchalmeti/company_uam > > Inside

Re: Run Any Python Project

2021-08-23 Thread Lalit Suthar
install requirements, possibly there'll be a file named requirements.txt run the command after going inside the directory `pip install -r requirements.txt` and it will do On Mon, 23 Aug 2021 at 11:32, MUGOYA DIHFAHSIH wrote: > but i think the error is so clear, there is no module named

Re: TypeError: 'str' object is not callable

2021-08-30 Thread Lalit Suthar
go like this messages.add_message(request, messages.WARNING, "failure message") return HttpResponse / render On Tue, 31 Aug 2021 at 10:32, Salima Begum wrote: > Hi, Thank you for your response. > I have defined as below I have mentioned snippet in all functionalities > i am getting error in

Re: roles and permissions

2021-08-14 Thread Lalit Suthar
https://www.django-rest-framework.org/api-guide/permissions/ On Sat, 14 Aug 2021 at 04:35, Mike Dewhirst wrote: > Have you looked at ... > > https://simpleisbetterthancomplex.com/tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html > > > > > -- > (Unsigned mail from my

Re: Help

2021-08-14 Thread Lalit Suthar
You should send a custom frontend url to the users, appending the parameters required. Now your frontend will received that and send a POST request with the params received to your DRF backend There you can verify the parameters and change the password On Fri, 13 Aug 2021 at 11:56, ola neat

Re: TypeError: 'str' object is not callable

2021-09-01 Thread Lalit Suthar
ing one line in the > settings.py file. > https://docs.djangoproject.com/en/3.2/ref/contrib/messages/ > > On Tue, Aug 31, 2021 at 11:22 AM Lalit Suthar > wrote: > >> go like this >> >> messages.add_message(request, messages.WARNING, "failure message") >>

Re: permissions mapping

2021-09-07 Thread Lalit Suthar
https://docs.djangoproject.com/en/3.2/topics/auth/default/#permissions-and-authorization On Tue, 7 Sept 2021 at 18:42, Ssentumbwe Enoch wrote: > I want to design a factory management application but I need some guidance > roles permissions. > I want to divide the floor into sections whereby a

Re: Auto populating business organization logos

2021-09-19 Thread Lalit Suthar
good point @Shishir Ram you can try getting favicon from the organization url they enter. I found a package for that also https://pypi.org/project/favicon/ On Mon, Sep 20, 2021, 6:49 AM Shishir Jha wrote: > I believe linkedin is not using any api. Why would they need that? All the > companies

Re: cannot get value(foreign key) after using distinct()

2021-10-18 Thread Lalit Suthar
since you are using .first() in the query, it will return only 1 object so I don't think using a for loop our 'category' in template will work On Mon, 18 Oct 2021 at 18:04, Katharine Wong wrote: > Hi all, > > There is a question when I use distinct(). > When I try to use the ORM(distinct &

Re: TypeError __init__() takes 1 positional argument but 2 were given

2021-10-19 Thread Lalit Suthar
try changing this def get_context_data(self, *args, **kwargs): context = super(registro, self).get_context_data(*args, **kwargs) to this def get_context_data(self, **kwargs): context = super(registro, self).get_context_data(**kwargs) refer:

Re: django datatable

2021-10-20 Thread Lalit Suthar
you can try bootstrap also On Wed, 20 Oct 2021 at 12:46, Abhishek Choudhury < choudhuryabhishe...@gmail.com> wrote: > Hi, > > You can use Tailwind CSS and it will significantly improve the UI. > > > Thanks and regards, > Abhishek Choudhury > > > On Wed, 20 Oct 2021 at 11:26 AM, Eugene TUYIZERE

Re: Modeform Foreign key column not working

2021-10-20 Thread lalit suthar
is `ConnectionTypes` a foreign key to `ConnectionDetails`? in that case you don't need to put it as a field in form, it will be added automatically in the form. On Wednesday, 20 October 2021 at 18:47:44 UTC+5:30 Aruna Priya wrote: > Hi, > > I am trying to create a form from model and the model

Re: What it takes to bring web application to a mobile app

2021-10-20 Thread Lalit Suthar
you can create apis with django-rest-framework and then can use them at all the backends for web and mobile. On Wed, 20 Oct 2021 at 12:58, Stijn Verholen wrote: > :D > On 19/10/2021 17:28, Planet X wrote: > > Hey there all all you Mind-blowing people > i am new in django i am trying to set my

Re: [DJANGO-TUTORIAL]

2021-10-16 Thread Lalit Suthar
- https://tutorial.djangogirls.org/en/ - https://docs.djangoproject.com/en/3.0/intro/tutorial01/ - https://www.youtube.com/playlist?list=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW On Sat, 9 Oct 2021 at 04:05, David Nugent wrote: > For interactive web pages, you are (almost)

Re: OnlineBook - High Performance Django

2021-10-16 Thread Lalit Suthar
thanks for sharing Brent :) On Wed, 13 Oct 2021 at 17:44, Brent Clark wrote: > Good day Guys > > I got this off news.python.sc, and thought I would share in case anyone > misses it. > > https://lincolnloop.com/high-performance-django/index.html > > Definitely some tidbits of information, esp to

Re: New to Django

2021-10-16 Thread Lalit Suthar
I recommand https://www.youtube.com/playlist?list=PLEsfXFp6DpzRMby_cSoWTFw8zaMdTEXgL On Sun, 3 Oct 2021 at 17:32, bnmng wrote: > I think you'll get a few opinions on this. My opinion is no. I feel the > docs are very good but difficult to understand as a beginner. I like > Mozilla's into

Re: Query help

2021-09-20 Thread Lalit Suthar
Sum, Count works when we try to get sum/count for a column, for this case you can try something like this def get_yes_count_by(id): user = User.objects.get(id=id) count = 0 for val in user.__dict__.values(): if val == "YES": count += 1 return count On Tue, 21

Re: List Index out of Range

2021-10-03 Thread Lalit Suthar
Adding to above 2 answers index error may also occur when your time_frame_list or responsible_list does not have the same number of items as your input_list. You should try bnmng' s answer also > Which line in your code is triggering the error? you check it with simple print statements or using a

Re: Use previously requested data in another request

2021-12-04 Thread Lalit Suthar
o test, SESSION_COOKIE_AGE = 5 * 60, > I added to the settings but there is still the same problem. > > On Fri, Dec 3, 2021 at 8:55 PM Lalit Suthar > wrote: > >> We can save that in any django model in ajax() request if possible. >> >> You can check if you have m

Re: Use previously requested data in another request

2021-12-03 Thread Lalit Suthar
We can save that in any django model in ajax() request if possible. You can check if you have modified `SESSION_COOKIE_AGE` ( https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SESSION_COOKIE_AGE ) if it is too less that might be the reason. On Fri, 3 Dec 2021 at 16:15, kayhan

Re: Exported filtered by date data in django

2021-11-20 Thread Lalit Suthar
`filter_val1` and `filter_val2` are coming from POST request so they are in `string` format. But the `created_at` field of the `EXPENSES` table is in `datetime` format. This is why the result of the filter() is coming as empty. The query will run fine when the 2 values compared are in the same

Re: How to retrive data from more than two tables with many to many relationships?

2021-11-20 Thread Lalit Suthar
refer: https://docs.djangoproject.com/en/2.2/topics/db/examples/many_to_many/ On Sat, 13 Nov 2021 at 00:08, Madhav Dhungana wrote: > *What I want?* > > 1 ) I want to add pages and pull the page meta data from pagemeta table. > One page will have more than on pagemeta. > >1. > >PageMeta

Re: Handling url in class based views.

2021-11-20 Thread Lalit Suthar
you can get that slug value from kwargs def get(self, request, *args, **kwargs): slug = self.kwargs.get("slug") also if you like to pass it in the context you can override get_context_data refer: https://ccbv.co.uk/ to know more about class based views you can refer to this playlist

Re: def post in ListView

2021-11-24 Thread Lalit Suthar
you can use `query_params` On Wed, 24 Nov 2021 at 19:04, bnmng wrote: > Hi everyone, > > Is there anything dangerous about this? > class ItemList(ListView): > model = Item > def post(self, request, *args, **kwargs): > self.request.GET = self.request.POST > return

Re: def post in ListView

2021-11-24 Thread Lalit Suthar
oh my bad that is available in django rest framework only On Wed, 24 Nov 2021 at 22:41, Lalit Suthar wrote: > you can use `query_params` > > On Wed, 24 Nov 2021 at 19:04, bnmng wrote: > >> Hi everyone, >> >> Is there anything dangerous about this? >> cl

Re: Multiple Templates in single list view

2021-11-24 Thread Lalit Suthar
I have gone through your views and template. They are looking fine to me. Are you getting any error? On Wed, 24 Nov 2021 at 23:02, Lalit Suthar wrote: > > Anyone plz review my code i am struggling to figure out what the issue > here is > > What is the issue you are trying to re

Re: Multiple Templates in single list view

2021-11-24 Thread Lalit Suthar
> Anyone plz review my code i am struggling to figure out what the issue here is What is the issue you are trying to resolve right now? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: def post in ListView

2021-11-24 Thread Lalit Suthar
sutharl...@gmail.com > wrote: > >> oh my bad that is available in django rest framework only >> >> >> On Wed, 24 Nov 2021 at 22:41, Lalit Suthar wrote: >> >>> you can use `query_params` >>> >>> On Wed, 24 Nov 2021 at 19:04, bnmng

Re: Multiple Templates in single list view

2021-11-21 Thread Lalit Suthar
we can go like ``` class Manager(...): def get_context_data(self, **kwargs): context = super() context["open_tickets"] = Ticket.objects.filter(status="OPEN") context["accepted_tickets"] = Ticket.objects.filter(status="ACCEPTED") context["completed_tickets"] =

Re: Re-write an application from Turbogear to Django.

2021-11-25 Thread Lalit Suthar
I would have chosen the first option, since we can have some relationships in the database and once all the apis are ready. We can easily pick React part. On Thu, 25 Nov 2021 at 23:03, Stamatia wrote: > Hi, > > I have a question that might need discussion. > I have a legacy application on

Re: CRUD OPERATION CLASS BASED API

2021-10-23 Thread Lalit Suthar
this series of blogs really helped me 1. https://www.agiliq.com/blog/2019/04/drf-polls/ 2. https://www.agiliq.com/blog/2019/04/drf-polls-related-objects/ 3. https://www.agiliq.com/blog/2019/05/drf-polls-model-serializers/ 4.

Re: Modeform Foreign key column not working

2021-10-23 Thread Lalit Suthar
cool! mention not :) On Thu, 21 Oct 2021 at 19:57, Aruna Priya Nagarajan < arunapriya.nagara...@gmail.com> wrote: > > yeah, it is a foreign key and I have put integer field instead of foreign > key in the model. I changed it now and its working by itself without > specifying ModelChoiceField. >

Re: New user

2021-11-07 Thread Lalit Suthar
good one https://www.youtube.com/playlist?list=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW On Tue, 2 Nov 2021 at 15:40, Indrajeet Singh Yadav wrote: > Hi, > Like you I also started django a while back. And i feel like djangogirls > is a good place to start. > Its a tutorial site. Search google. > They

Re: converting audio file in Django

2021-11-07 Thread Lalit Suthar
https://stackoverflow.com/questions/3049572/how-to-convert-mp3-to-wav-in-python On Wed, 3 Nov 2021 at 18:52, Shada Bahassan wrote: > Is there any platform command line utility that can convert audio file > from ul formats to wav format? > > -- > You received this message because you are

Re: Use previous requested data in the new request

2021-12-01 Thread Lalit Suthar
why can't we make a post request directly On Wed, 1 Dec 2021 at 00:24, kayhan wrote: > Hi > How to first send some data with an Ajax request to Django view and then > with a post request, send the form information to the same view and use the > data sent in the previous request (Ajax request)

Re: Developing django apps in jupyter

2021-11-29 Thread Lalit Suthar
I use vscode On Mon, 29 Nov 2021 at 21:40, Vikas Sri wrote: > I recommend Pycharm, it makes development fast, helps in debugging and > what not. > > On Mon, Nov 29, 2021 at 8:34 PM Md Rana Sarkar > wrote: > >> You can create virtualenv and use VS code . That's the free and better >> IDE for

Re: runserver not working

2022-03-22 Thread lalit suthar
haha indeed On Wednesday, 23 March 2022 at 09:08:54 UTC+5:30 Delvin Alexander wrote: > it was python manage.py runserver. it was an easy fix that i wish i found. > hahah > > On Tuesday, March 22, 2022 at 8:32:46 PM UTC-7 Delvin Alexander wrote: > >> i did that but the problem still remains :(

Re: django queryset - Get the data particular to current year only

2022-04-03 Thread Lalit Suthar
I think this is related to your query https://stackoverflow.com/a/28101722/8882295 On Thu, 31 Mar 2022 at 11:22, Trippy Samurai wrote: > > > > I have my query written to get some thing from database and display on my > website that query is

Re: order_by on the basis of time difference (updated_at - created_at)

2022-01-21 Thread Lalit Suthar
won't be possible like this, It will be easy if you have another entry in models which stores the difference between updated and created. You can update that field whenever an object is updated. And then can run order_by on that field directly On Fri, 21 Jan 2022 at 10:24, Aadil Rashid wrote:

Re: order_by on the basis of time difference (updated_at - created_at)

2022-01-21 Thread Lalit Suthar
Fabio C. Barrionuevo da Luz's answer will work like a charm! On Fri, 21 Jan 2022 at 21:04, Fabio C. Barrionuevo da Luz wrote: > this can be easily solved by using an annotation to calculate the > difference and store it in a new temporary column, and then sort by it > > > from

Re: Negated filtering by lookup expression sent via url query

2022-05-31 Thread Lalit Suthar
you can write custom filtering classes and methods using Django filters. There you can define fields and methods according to your use case example: https://stackoverflow.com/questions/43009538/use-custom-filter-with-django-modelchoice-filter On Tue, 31 May 2022 at 19:16, Sencer Hamarat wrote:

Re: Need help

2022-06-01 Thread Lalit Suthar
thanks for sharing @Antonis Christofides I was looking for a resource like this for some time :D On Thu, 2 Jun 2022 at 10:57, Antonis Christofides < anto...@antonischristofides.com> wrote: > Hello, > > If, as I understand, you don't know anything about deployment, a possible > starting point is

Re: LogIn Class Based View

2022-05-27 Thread Lalit Suthar
refer: https://docs.djangoproject.com/en/4.0/topics/class-based-views/ https://www.youtube.com/watch?v=Xeh9r0CXBmU=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW=36=1s On Fri, 27 May 2022 at 01:07, 'dtdave' via Django users < django-users@googlegroups.com> wrote: > I have this function based view which

Re: Need best tutorial

2022-06-21 Thread Lalit Suthar
https://github.com/lalit97/django-developer-resources On Tue, 14 Jun 2022 at 06:49, Abdul Qoyyuum wrote: > Don't go straight to web development until you understand how Python > works, especially when dealing with imports and managing variables in > different scopes. > > I recommend learning

Re: Best approach for audit logging in Django.

2022-06-03 Thread Lalit Suthar
Hi Sencer, signals will be helpful only if you are auditing on certain models but if you are trying to audit a set of views then middleware will be a better choice since that will be more manageable On Fri, 3 Jun 2022 at 18:29, Jason wrote: > one good source when you have a question "is there

Re: Looking Best Learning Resources Python / Django

2022-07-19 Thread Lalit Suthar
https://github.com/lalit97/django-developer-resources On Tue, 19 Jul 2022 at 21:02, Muneeb Mughal wrote: > I am looking for best learning sources for web and more in django or any > related framework with complete practice and also lead to job , > experience people recommend only .thanks . > >

Re: DRF question

2022-07-19 Thread Lalit Suthar
I would also suggest keeping Django views as it is and writing new views for your APIs maybe you can create another file named apiviews.py and then write new APIs with help of your present views refer: https://www.django-rest-framework.org/api-guide/views/ On Tue, 19 Jul 2022 at 06:38, Nikhil

Re: Starting Django

2022-07-15 Thread Lalit Suthar
https://github.com/lalit97/django-developer-resources On Fri, 15 Jul 2022 at 12:00, Lalit Suthar wrote: > https://www.youtube.com/playlist?list=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW > > On Fri, 15 Jul 2022 at 03:55, fawemimo olawale > wrote: > >> >> Dear All, >

Re: Starting Django

2022-07-15 Thread Lalit Suthar
https://www.youtube.com/playlist?list=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW On Fri, 15 Jul 2022 at 03:55, fawemimo olawale wrote: > > Dear All, > You get a video a from brad Traversy from Udemy or Mosh from > codewithmosh.com > Regards > > -- > You received this message because you are subscribed

Re: Hi to all how to implement Search option in website?

2022-07-23 Thread Lalit Suthar
you can try django-filters also for more complex use cases https://django-filter.readthedocs.io/en/stable/ On Sat, 23 Jul 2022 at 22:09, Lakshyaraj Dash wrote: > You can do something like shown in the screenshot below > > Thanks and Regards > Lakshyaraj Dash > > On Sat, Jul 23, 2022, 21:59

Re: Help to implement join query in django orm

2022-07-23 Thread Lalit Suthar
this can be helpful https://betterprogramming.pub/django-select-related-and-prefetch-related-f23043fd635d On Sun, 24 Jul 2022 at 00:30, Ryan Nowakowski wrote: > On Fri, Jul 22, 2022 at 12:16:14PM +0530, Avi shah wrote: > > I have two tables > > Tbl 1 > > & > > Tbl 2 > > > > I need to connect

Re: hello users

2022-07-27 Thread Lalit Suthar
https://github.com/lalit97/django-developer-resources On Mon, 25 Jul 2022 at 19:04, Aliyu Muazu wrote: > i'm currently new here, any guide up on where to start. > thanks > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe

Re: Django tutor.

2022-07-27 Thread Lalit Suthar
https://github.com/lalit97/django-developer-resources On Wed, 27 Jul 2022 at 22:22, nick washington wrote: > Cool > > On Wed, Jul 27, 2022, 18:19 Md Aminul Haque > wrote: > >> Show Django Official website >> >> Sent from my Huawei phone >> >> >> Original message >> From:

Re: 'str' object is not callable

2022-05-06 Thread Lalit Suthar
this part of the code looks fine from a first look. Can you share the complete view code for this On Fri, 6 May 2022 at 12:11, Salima Begum wrote: > Hi all, > In my project I am Django messages Framework. I am always facing 'str' > object error I dont understand how to solve this problem.

  1   2   >