Orack
https://stackoverflow.com/questions/56385197/post-nested-json-in-postman-formdata
Orack
https://stackoverflow.com/questions/56385197/post-nested-json-in-postman-formdata
can any1 explain what does he explain in his founded solution
Anonymous
Do you mean migrations?
No, I’m too new to postgre, when I log in to pgAdmin 4 on the left side there’s a tab named Databases when I press it, two databases show up one named test and the other named postgres no on pycharm I connect normally to the database, but all the changes effect only postgre but not test! in the phAdmin page when I press postgre in the SQL right side tap shows a comment says that postgre is the default database
Muflone
I think you have to switch database, maybe with use NEWDB
Muflone
Or change connection properties
Anonymous
Or change connection properties
it’s connected well using the test option
Muflone
yeah it’s dJango project on pycharm
Django uses settings.py, not pycharm connection
Anonymous
Django uses settings.py, not pycharm connection
🌝💔Pycharm is an IDE just like VS code and sublime but with built in libraries
Muflone
What matters with Django?
Anonymous
What matters with Django?
The problem isn’t with django
Anonymous
Nobody gets me right 🌝💔
Anonymous
have you guys ever used postgreSQL before?!
Muflone
change your database in your postgres connection
cj
have you guys ever used postgreSQL before?!
you must be the first one on the earth using that thing 🤷🏻‍♂️
Anonymous
you must be the first one on the earth using that thing 🤷🏻‍♂️
🌝Who knows!? I might even build it accidentally!
Muflone
how you created the connection, you set user, password, add database=dbname
Muflone
or whatever you actually use
Myrza
how i solve this problem
Myrza
Could not parse the remainder: '=="dashboard":' from 'section=="dashboard":'
Myrza
i google it but nothing found
Sh
In django how can we cast str field to datetime field.
Sh
using Cast function?
Sh
I tried many ways.
Sh
in my db i am storing the date as CharField with 'dd/mm/yyyy' format.
Sacs
A screen shot will be elaborate
Sh
but i wnt the date to be in datetime object
cj
but i wnt the date to be in datetime object
use datetime to parse a date from a string
Sh
how will u convert '22/12/2019' to int.
Sh
i am talking something about this : https://docs.djangoproject.com/en/3.0/ref/models/database-functions/#cast
Sh
use datetime to parse a date from a string
Cmonn!! as a Python/Django dev, wont i know that
Sh
I want to do at db level
Sh
use datetime to parse a date from a string
https://docs.djangoproject.com/en/3.0/ref/models/database-functions/#cast Something like this. here they are converting int to float. What can we do for string to Date?
cj
https://docs.djangoproject.com/en/3.0/ref/models/database-functions/#cast Something like this. here they are converting int to float. What can we do for string to Date?
at least have you tried? also if that works, you have to set a date_format for the DateField to fit the dd/mm/yyyy from your string
Sh
U try it.
Sh
I have already tried.
Sh
didn't work
cj
U try it.
that's not my issue 🤷🏻‍♂️
Sh
and i checked in google too. Nowhere they have given it.
Sh
So asked it here.
cj
I want to do at db level
why? do you have a strong reason for that?
Sh
u are giving solution as if I am a newbie.. If i am posting something here then obviously I would have done enough research!
cj
as using Cast class at Python level would be the same as casting using the resulting value with datetime
Sh
yes. its a product requirement. I dont want to do in memory
Sacs
how will u convert '22/12/2019' to int.
After u get the value from the db Won't u store in a string?
Orack
https://hastebin.com/apahawojuy.py
Orack
I have this serializer, it shows { "error": { "userid": [ "user with this userid already exists." ] } }
Orack
even if i do User.objects.get() why ?
Arturo
because serializer try to validate the data before enter in creation method
Arturo
use .update() method, because you are updating, not creating a new user
Orack
use .update() method, because you are updating, not creating a new user
I want to create if it doesnt exist or then update
Orack
so if it exists will it automatically move to update() ?
Arturo
yup
Orack
yup
https://hastebin.com/adaruqibid.py
Orack
like this ?
Jose Luis
what about this?
Jose Luis
mmm
Jose Luis
https://pastebin.com/x0NkEynH
Jose Luis
which is better?
Arturo
first
Jose Luis
ok
Jose Luis
thanks
Leonardo
guys, drf framework do not encapsulate PUT/DEL request methods?
Leonardo
because i've tried
Leonardo
should i create these methods by my self?
Mirco
Nope
Mirco
https://www.django-rest-framework.org/tutorial/3-class-based-views/#using-generic-class-based-views
Mirco
Read destroy and update methods
Mirco
Into the GenericAPIView or mixins
Leonardo
i'm using generic view
Mirco
You have destroy and update methods
Leonardo
but its not destroying
Leonardo
im using postman to make api calls
Mirco
Destroy is a wrapper for DELETE