Андрей
select_related will work if i want to reduce queries from B and C models, to get some info from A model like:
c = C.objects.filter(a_id=1).select_related('a')
print(c.a__some_info)
Mirco
Cacio Lucas
How can I make a queryset to return a model entity and a count of how many times it appears as fk in another model table?
.
Can you show me a sample site made with django?
Sergey
Sergey
Cacio Lucas
Thanks anyways :)
Cacio Lucas
I'm trying now to annotate a field that should be (timedelta(days=F('integerfield))+F('datetimefield)), but It's not working, does anyone know how can I do it?
.
Mirco
Cacio Lucas
http://linkode.org/#BPGSpzIBGxSMFCkyACMo7
Shreehari
Hey guys, if anyone has a detailed hands-on guide on ModelViewSet then please share
Mirco
Shreehari
Shreehari
Frankly i am not able to find much difference between modelviewset and generic views.
Shreehari
Mirco
Anonymous
Hello friends. Is it possible translate the URL’s with Rosetta ? Example: domain.com/es/contacto , Domain.com/en/contact?
Mirco
عــمــر
I have a problem, i have path
/<token>/
Then its shows ) 1 pattern tried not found
عــمــر
Why ? Every think its correct i dont know whats is the problem!
Anonymous
Anonymous
Check it again
عــمــر
I checked it
عــمــر
Every think correct, and i try to change it
Rocky
How to add external css file in django...?
😇ANGELO™️🎧
How to add external css file in django...?
Make it a static file. And connect it in the main settings.py file that you created.
It's found in the last section known as STATIC.
I'd there are images you could also store it there.
DM me and let's talk if you still can't do it
عــمــر
How can i change the data when i have a model form
I want to change the data before
form.save()
عــمــر
When i edit the “ form.data “ its show that i cant edit it
Sergey
Lucid
How can I get data from uploaded excel file then sum up the specific fields entities
Lucid
I tried alot to find the appropriate and implemented some but didn't get the desired output I would be very grateful if anyone would give me some guidelines
Anonymous
maybe use pandas
cj
Lucid
Could you please elaborate more which functions specifically
Anonymous
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_excel.html
I believe its the read_excel function
Lucid
Anonymous
no problem
Anonymous
I have hosted my Django app on Heroku but I have a questions
1. how can I access my app database now that's on heroku.
2.Django gave me a secret key how can I make my repo public without revealing this
Thanks.
This is my first Django project
հօรรεiռ
hi is there a way to use datatables in django?
Mirco
cj
U serious ?
seems that people are banned from using Google/DDG ¯\_(ツ)_/¯
Mirco
հօรรεiռ
Mirco
Mirco
yes😹
Come on, open Google or DDG and have a quick search or just start reading documentation
հօรรεiռ
Anonymous
հօรรεiռ
i found something
but they were not for admin panel
cj
հօรรεiռ
yes sorry
cj
so, people ask for X thing, but they really want to do Y thing...
🤦🏻♂️
հօรรεiռ
Mirco
Mirco
Anonymous
հօรรεiռ
ok thanks guys
Mirco
thank you
https://12factor.net/
A must to read
Mirco
Someone
Hey, I am working on payment module. Integrating with payment gateways.. What design pattern should I follow for good code and best performance.. As of now am integrating only one gateway, but in future we will add multiple gateways, coupon system, running offers and incentives on orders, etc. I would like to start with all those in mind, however am not sure which pattern or method to use for good code and good performance. Any suggestions?
Anonymous
Anonymous
For design it'll depend on design of you database whether you have a separate gateways for coupons and orders ...
Oleg
Guys, how to get to know if self-referecing onetoone field is already referenced by another object? (I need to handle this case: "duplicate key value violates unique constraint")
Oleg
I know that it's easy to get rid of needless objects (that are already have reference from somewhere else) in filter (with pk__isnull)
Database.objects.filter(db_dr_field__pk__isnull=True)
but how to apply it to one object and check only one object reference?
I want something like: obj.related_name__pk__isnull
Iran
Hello I need deploy django pdf
Mirco
cj
Sumit
Hello everyone, I want to know how to identify the device in django, my concern is that if a user logged in with another device , a device verification code has to be sent on his email.
🌙