Orack
https://stackoverflow.com/questions/56385197/post-nested-json-in-postman-formdata
Orack
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
Muflone
I think you have to switch database, maybe with use NEWDB
Muflone
Or change connection properties
Anonymous
Muflone
What matters with Django?
Not Your Dad
Anonymous
Nobody gets me right 🌝💔
Anonymous
have you guys ever used postgreSQL before?!
Muflone
change your database in your postgres connection
Anonymous
Anonymous
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
Sacs
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
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
Sh
U try it.
Sh
I have already tried.
Sh
didn't work
Sh
and i checked in google too. Nowhere they have given it.
Sh
So asked it here.
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
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
Orack
Arturo
use .update() method, because you are updating, not creating a new user
Orack
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?
Mirco
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