Muflone
search/pricemin/pricemax/name/
x-yro
search/pricemin/pricemax/name/
im sorry but i need, to be passed to the title ?q=kalsii, now just the title string is passed, 'http://127.0.0.1:8000/search/title/?price_up=5000&price_down ='
x-yro
and ty too
x-yro
ohh
Muflone
you can do that, but you're not using the django arguments handling, so no checks are performed over those data.
Muflone
you can proceed how you prefer. btw django parse arguments using urlpatterns, which is a sane way to process for django. for your problem there's no big difference, simply provide all the arguments and filter your data accordingly, not just price min or max or description but every arguments everytime (defaulting to None in the case it's not needed)
x-yro
ok, ill try tysm
Muflone
look also at the example, it handles multiple optional arguments
x-yro
look also at the example, it handles multiple optional arguments
yeah i tried example, but when I enter the inputs to filter out the price of already received products, as I said before, the filters are overwritten, but if I enter all the filters manually in the address bar, then everything works
Muflone
yeah i tried example, but when I enter the inputs to filter out the price of already received products, as I said before, the filters are overwritten, but if I enter all the filters manually in the address bar, then everything works
your issue is not related to django but how you're sending the request from the html page. every request must pass all the 3 arguments, not only a single. check your form or whatever you use to send the request back to django
Muflone
what's reloading your page?
x-yro
what's reloading your page?
when me putting price value here is my form: <form action="{% url 'search_results' %}" method="get"> <input type="text" name="price_up"> <input type="text" name="price_down"> <button type="submit">Lar</button> </form>
x-yro
where is the product filter field here?
u mean search field? if yes then it is in another template
Muflone
u mean search field? if yes then it is in another template
then how would you want to have both filters active at the same time if you're requesting price_up and price_down only?
x-yro
then how would you want to have both filters active at the same time if you're requesting price_up and price_down only?
at the beginning, in another template, I use a filter that filters products by titles, and then in the template with the results I pass the resulting two filters
Muflone
your workflow is broken by design the form MUST submit all the required information. pass every needed information to the form, that's all (this is html, not django)
x-yro
That is, I need to pass all the filters in one request. I get u tysm ❤️
Позывной "ПАПА"
hi, i'm trying to make a parser application for django+celery, I run a task through celery from 270 pages, it parses, but as soon as I go to the site, I get data from the db, and at that moment I get an error, what could be the problem? error: django.db.utils.OperationalError: disk I/O error
Anubhav
That is, I need to pass all the filters in one request. I get u tysm ❤️
U can make a field filter that accepts list or json data and whenever user clicks on any filter add it in your filter field and show them the result and again if he apply any filter add it in your filter field and so on ...also add one button for clear filter in your html ...to remove all the filters
Anubhav
@xyro2005 you can also use ajax for database interaction
Anubhav
And your page doesn't reload
x-yro
And your page doesn't reload
tysm, it will be necessary to learn ajax in this case
Muflone
tysm, it will be necessary to learn ajax in this case
Modern JS, ajax is obsolete nowadays
x-yro
Yes, I know that it is already possible to do all this on js without additional libraries, the problem is that I haven't studied js yet.
Mobi
Can someone guide how can I set unique true all together in 5 fields, so that all five should not have a duplicate
Mobi
unique_together =
I tried that but it’s not working, fields are MAC address, I have wlan1,wlan2, ether1,ether2,ether3 fields. Unique_togather doesn’t do the job if a Mac Address is in wlan1 I can add it to wlan2 or ether1 etc , I want if a MAC address is present in any field , it should not be added in db.
Patrick
try def save put required validations
Mobi
try def save put required validations
I am new to django can you explain more plz
Patrick
under that model... put def save(self, *args, **kwargs): access fields by self.field name put validations and return validation errors all good?? then: super(ModleName, self).save(*args, **kwargs)
Toto Syrax
youtube using python for ai and search system
I m talking about django bruh AI with django?
Thainan
hi guys, how to give in LIST to django include template? For example: {% include 'components/tables/table.html' with theadFields=['field1', 'field2', 'field3' ] %} This is my code, but i get syntax error
Muflone
or in a single operation with theadFields="field1, field2, field3".split
Thainan
split does that already
this way is doing through space
Thainan
the return is: field1, field2, field3.. is not field1 field2 field3 without ,
Muflone
pass it without commas then
Muflone
or create a custom filter
Thainan
but, if pass .split(", ") return error... i want split for commas
Muflone
don't use commas, simple
Thainan
but, if i have a field "Last Name" the .split create two elements, "Last" and "Name"
Thainan
why separeted for espaces
Muflone
you may try using .split ',' but I think it won't work you have to create a custom filter
Muflone
templates are very limited and you shouldn't add too much logic in them in any case you can create as many filters/tags you want
Thainan
templates are very limited and you shouldn't add too much logic in them in any case you can create as many filters/tags you want
i don't have experience from django, i started from last two weeks, i am learning.. thank you very much for all help
Thainan
but, i to go search for django filters tags, thanks
Anonymous
Am doing an ecommerce project and am unaware of how to do the admin side also want to add details of produxts dynamically am using postgres sql can anyone suggest any tutorial with these items included
THANH
How to using Gmail to send email form member. I using Gmail in domain.com error: [Errno 111] Connection refused
Олег
Hello everyone, can you say me, which connect https protocol to Django? I use docker-compose and nginx. What I need to add to nginx and docker-compose. I used Ubuntu 22.04 on Hetzner.
Doragonsureiyā
Hello everyone, can you say me, which connect https protocol to Django? I use docker-compose and nginx. What I need to add to nginx and docker-compose. I used Ubuntu 22.04 on Hetzner.
To get an answer to your question, it is worth to formulate it more clearly, perhaps add more details, perhaps add explanations.
Mohammad
I want to use AsyncHttpConsumer in django channels. but url address for my route returns 404 how can I add this path to my django server?
Rishabh
hello please help me My Usermodel make in aws lambda functions now I have to make apis in django and now I make new tables in db with django now I have to make some apis in django when I make table in model.py file and run makemigrations command I get no changed detected and no table in db
Vikash
Hey guys I have a query regarding uploading videos on aws s3 bucket when I upload locally its work fine and video stored in bucket but when I do same thing on server it's not storing and i didn't found any response in postman
Cyber
Hey i am struggling with implementation of authentication in Django and next js any one help
Cyber
It's on local host
Mirco
It's on local host
Yeah but u have nextjs on another port right ?
Cyber
Yeh
Cyber
I basically connect it and i found in next js there is a next auth or something. But the thing is i don't wana do social media auth . I want to use my custom auth for that .?
Mirco
Yeh
So you cannot use session auth You have to go for a Token Auth
Cyber
I am using jwt auth
DoT
hi i want to add multiple lang option to my website can anyone help me with doc / tutorial videos
Juan Carlos
hi, am learning about orm , I have this class models order(id,date,fk_customer_id),customer(id,name), detail_order(id, fk_product_id,fk_order_id), how can i make an query using select_relaction to send from views to orders.html and print an li all order with customer.name
Juan Carlos
orders = detail_order.objects.all().select_related('fk_order_id') return render(request,'orders.html',{'order':orders})
Juan Carlos
only works this one, I can use detail_order with order fieldes but i can't tie order with customer to send customer.name
Juan Carlos
yes, i wont to print a <li> with order_id with produc_id in that order and customer_name . for example
Juan Carlos
I do it with sql with 3 inner join but I cant with orm