Jhoan
How can i migrate from modelserializer to dict if i already have functions there
Sofia
Hi, when i try to put request in nested writable serializer İ receive (Error =Str object has no attribute get ) İ use drf-writable-nested library
Sofia
Hi, when i try to put request in nested writable serializer İ receive (Error =Str object has no attribute get ) İ use drf-writable-nested library
File "C:\Users\V I S I O N\Desktop\amazon\.venv\lib\site-packages\drf_writable_nested\mixins.py", line 108, in _get_related_pk pk = data.get('pk') or data.get(model_class._meta.pk.attname) AttributeError: 'str' object has no attribute 'get
Sofia
Show the code and the full error (read rule 5 on pinned post)
https://linkode.org/#ZUEH4E88NhsMXsGuqaRw92
Charly
https://linkode.org/#ZUEH4E88NhsMXsGuqaRw92
So in which linea are you getting the error?
Sofia
So in which linea are you getting the error?
File "C:\Users\V I S I O N\Desktop\amazon\.venv\lib\site-packages\drf_writable_nested\mixins.py", line 108, in _get_related_pk pk = data.get('pk') or data.get(model_class._meta.pk.attname) AttributeError: 'str' object has no attribute 'get
Sofia
Thats not the full error
https://linkode.org/#Ky1TAlrzd8gZRSbyrwPGM1
Sofia
Thats not the full error
could you find any solutions?
Charly
could you find any solutions?
can you print the request.data?
Sofia
can you print the request.data?
in action me get or put?
Charly
in action me get or put?
put is whenis failing, right?
Sofia
yes
when i print(request.data) before return in put the same error recived and any thing don't printed
Tushar
How can I create a multiple table in one django model
Vigneswaran
Hi friends i need help I'm facing issues in django when I'm try to connect with MySQL django.db.utils.NotSupportedError: MySQL 5.7 or later is required (found 5.6.23)
Vigneswaran
Yes
Charly
How can I create a multiple table in one django model
A model is mapped to a single table, why do you need that?
Charly
Yes
An do you understand that you need a newer version of mysql?
Vigneswaran
I'm currently working in MySQL workbench
Charly
Vigneswaran
The version is 6.3
Charly
I'm currently working in MySQL workbench
MySQL is not the same as MySQL workbench
Charly
Workbench is just a GUI for MySQL
Tushar
then use other model
How? I don't have any idea
Vigneswaran
Ok thanks bro
Charly
How? I don't have any idea
Create an aditional model as the one that you created
kmk
hello guys. help me please. I have a written project on drf with a finished database postgres I need to write a microservice and connect it to an existing database. gives me an error ImproperlyConfigured at /api/users/ settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
Tez
Hello guys, Am creating an recipe app in django. I want the users to be able to shop ingredients from the site such that,when you click on a recipe,you'll see a 'buy ingredients' button. When you click it,it navigates to the shop and your items (the ingredients) appear at the top. Is there anyone who can help me achieve that?
kmk
Read the error carefully, it says your database config is not right
I don't see wrong in this db config. other proj works with it. mb u know& https://pastebin.com/egmu3vXr
Tez
So specifically, what have you tried or where are you stuck?
I had used get_absolute_url but it doesn't give the results I want.
Charly
I had used get_absolute_url but it doesn't give the results I want.
I think you may do something like this: - In the recipe page have a list with ids of the desired products - Add a view that searches for these products and add it to the cart - In the recipe view add button that calls that view - In the add to cart view collect the products fill the cart and redirect the user to the cart
Sofia
https://linkode.org/#Ky1TAlrzd8gZRSbyrwPGM1
Any one know why this error occur?
Charly
User
I am developing a django application that uses sendgrid api to send emails. In scheduling the emails, if I have schedules it after 15 mins, then I am getting the email after bi 5 hours 30 mins. I have explained my question in detail on the following question of stack overflow question: https://stackoverflow.com/questions/73697975/scheduled-messages-are-sent-at-difference-of-5-hours-30-minutes-in-twilio-and-se
User
Can anyone please help me with this topic ?
Sofia
Show the request.data
request.data is empt
Charly
request.data is empt
Then thats the issue, right?
Sofia
Then thats the issue, right?
When we send put request occur error and don't print request.data And in get request that is empty
 ‌‌‌‌Hamed
Hi guys I load osm data of my country in postgis db now how I can make an map from my dB tables: Planet_osm_nodes ............._road, ............_ways, ..........._point, .. I want to make an networkx graph from this data?
 ‌‌‌‌Hamed
Iits possible?
 ‌‌‌‌Hamed
I use this networkx graph data in osmnx package
Hamza
Image reach from front end as base64 I want to convert it to image and save in database
Sofia
When we send put request occur error and don't print request.data And in get request that is empty
I solve that problem but now i have another problem. When Created a user automatically created a customer and address field but when we try to put address in nested writable serializer fields. address was deleted automatically
Murat
Hi everyone! I have troubles with django staticfiles. i'm trying run server via gunicorn in production, but my django admin static files with css and js files doesn't load. If i run my server via python manage.py runserver it works correctly. Django server wrapped in Docker container.
h
Someone can solve Integrity Error ?
c64
Hello everyone, I have a rather simple question I guess. this line of code: public = str(request.GET.get('public')) != '0' means, public becomes the value of the request.GET entry for 'public' if it is not 0, otherwise public is intialized and becomes 0, right?
X_ShaygaN_D
Yes
How
Ali
Who Django core headers do you know
Doragonsureiyā
Who Django core headers do you know
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
U
Can any one guide me about creating formset dynamically using Javascript
Maxim
Can any one guide me about creating formset dynamically using Javascript
this is not a Javascript group no, Javascript is not a part of Django
Doragonsureiyā
Someone can solve Integrity Error ?
Not until you explain your difficulties.
U
@MaxZhurkin i got the point what u r going to convey. I think u didnt get my question correctly. My question is about creating dynamic newforms in a django formset via Javascript
U
Can any one help me in guiding to create dynamic newforms in a django formset via Javascript
Swati
what is the use of get_queryset method in rest
Danilo
How can i call a method automaticaly when my state field == ‘published’
Mirco
How can i call a method automaticaly when my state field == ‘published’
you can override the save method of model or u a post_save signal check the state and call your method
Ali
hello guys Has anyone worked with initial data in Django? my qz is how to improve image object in Json or Yaml file to load with manage.py? I have a model called Avatar includes thumbnail which is an ImageField and I wanna create initial data in Json file for that and I don't to how to pass image to db in file bcs now im gettting the empty string in admin panel for that field and it's just a string there is no image (: #load_data #initial_data #image_field #django_models
Ali
Or you use base64 or you just return in your JSON the media URL to your image Don't use blobs
could u pls give me an example or web reference for that? for both ways u said i have no idea how to do that my initial_data.json file [{ "model": "comments.avatar", "pk": 1, "fields": { "thumbnail": "static/avatars/ava-1.png" } }]
Karkar Maneh
Please some one tell me how to make folder in django web page
Ali
could u pls give me an example or web reference for that? for both ways u said i have no idea how to do that my initial_data.json file [{ "model": "comments.avatar", "pk": 1, "fields": { "thumbnail": "static/avatars/ava-1.png" } }]
another challenge is that i have no media files that i can pass links bcs it should be ignored in project and if i copy images in media and pass links to initial_data.json it works but we should not use media files and track them in project