Rohan
Handled xD
inchidi
Rohan
Bare except and what not
Rohan
Hardly serves any purpose
Ajay
Ok thank you
Turtle_In_Hurry
POST {"user" : ["1", "2"]}
im sending this manytomany field from postman but how to get it at backend from request object
Turtle_In_Hurry
DRF Question
Mirco
Python2411
of my error. in which web site ?
Mirco
Or use sharing image tool
Balamurali
Any freelancers here?
Python2411
ok
Hesen Nivas
Balamurali
@GotHackedByHer please check your pm
Turtle_In_Hurry
I have all things created
Turtle_In_Hurry
I created models
Turtle_In_Hurry
And just need to know how to save it after getting it from request object
Turtle_In_Hurry
Model_name.object.create(email=email, name=name)
Turtle_In_Hurry
By this way i cam save normal field
Turtle_In_Hurry
But how about manytomany fields
Mirco
Read better official docs about it
Aadhi
Anyone knows about MultiValueDictKeyError
Derrick
Anyone with this book
RESTI API with DJANGO by William S Vincent
Neo
Derrick
Anonymous
Hi everyone
Mirco
Rangaraj
How to convert django query set to python list of list
Format of the list something should be like this
[
['timestamp','Generation','forecast'],
[2007-01-18 00:00,33.45,45.33],
[2007-01-18 00:00,33.45,45.33],
]
I need List of list output. First row of data tells the headers of the model table
George
Anonymous
I am writing an account app so users can authenticate
Login, reset password ....
I have a one to one relationship Profile for users
Now I've added Google auth so users can log in with Google
But the problem is that Google users won't have a profile so that's an Error when they request their profile
How can I solve this?
Mirco
Adonis
Anonymous
Adonis
Yes I'm using
social-auth-app-django
In the doc there is a way to make personalized configurations... Try to check if one of those method can help you..... I think
associate_user
can help you
Adonis
Just try to add a code there to create the user profile after it has been created by the plugins... I usually use django-all-auth to do that
Anonymous
Thank you, I'll read that
But how about this:
I added some code to view function that is called when user requests their profile
In that view function I make a profile for user if hey don't have one
Is it good practice? Is it considered bad a solution?
Anonymous
Personally I prefer to make user profiles the moment they sign up
This sounds like a right solution
Adonis
Rangaraj
Why do you want this result ?
Actually am using one common model to have actual and forecast data that is filtered with one field called type. I want to display the result in graphos line chart. Everything works fine if we give data in the above format.
But problem is with conversion of the query set to list of list type.
As per graphos manual we need to specify the first row as header information and first column will be taken for X axis.
Mirco
Marcos
How can I change this default "Filter by Year" field when I use SimpleListFilter so that the default "Todos" = "all" option does not appear, but start with the actual years? https://imgur.com/Y0vbate
Um
yo ... isn't it ok to have static file on webpage instead of forms?
Doug
Um
first i thought i would make an models for forms . but then used html
Um
isn't that ok
Doug
What are you trying to accomplish
Um
Um
onclick= location.href mailto:111@11.com
Um
but it opens outlook
Um
thought i would get away with html .. but i think i have to make a form😑
Anders (izzno / gooood) 🇳🇴
Great bundle...
https://www.humblebundle.com/books/web-programming-oreilly-books
Carlos
Hi guys, I have a question, which is better for deployed django project. Amazon webbservice or azure?
אהיה
Hello guys
Mirco
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
They even have a magic config (droplet with django preinstalled.)
Artyom
Hi! Why this query generate empty csv? (no column titles too): def report(self):
report = RentAddres.objects.raw("""
SELECT id, name, snameplp, fnameplp, patronymicplp, identity_doc,
serial_doc, number_doc, ogrn,inn
FROM renter_renters
LEFT JOIN renter_rentaddres
ON renter_renters.id = renter_rentaddres.renters_id, renter_rentaddres.city;
""")
return djqscsv.render_to_csv_response(report)
Artyom
id columns in both models (primary keys) are automaticlly genereted by django (not defined in model)
.
Hi! Why this query generate empty csv? (no column titles too): def report(self):
report = RentAddres.objects.raw("""
SELECT id, name, snameplp, fnameplp, patronymicplp, identity_doc,
serial_doc, number_doc, ogrn,inn
FROM renter_renters
LEFT JOIN renter_rentaddres
ON renter_renters.id = renter_rentaddres.renters_id, renter_rentaddres.city;
""")
return djqscsv.render_to_csv_response(report)
why do you use raw sql? use values from queryset
Artyom
why do you use raw sql? use values from queryset
when I did something like this : report = Renters.objects.all().values('name','snameplp','fnameplp','patronymicplp','identity_doc',
'serial_doc', 'number_doc','ogrn','inn').union(RentAddres.objects.all().values('subject','city',
'street','house','housing','number_doc'))
return djqscsv.render_to_csv_response(report)
Artyom
function returns csv with Renters objects only..
tk
Anyone give me Django project
.
when I did something like this : report = Renters.objects.all().values('name','snameplp','fnameplp','patronymicplp','identity_doc',
'serial_doc', 'number_doc','ogrn','inn').union(RentAddres.objects.all().values('subject','city',
'street','house','housing','number_doc'))
return djqscsv.render_to_csv_response(report)
in values you can get foreign object's field like 'address__city_name'
tk
Guys anyone have Django project
tk
Please give me with source code
Artyom
tk
Academic project anyone having