Shainkey
Try to paas flat true and get the list and manage accordingly
Patrick
Hi! I have a table with a ManyToManyField and I'd like to use bulk_update_or_create (or an alternative). Has someone an idea? Thank you in advance Here is my code: https://paste.chapril.org/?9bae495bec70abd9#8q5xCMLNzEdi9kvhvWw6EC8U3VZScEyrvLSpd6y4yap9
Doragonsureiyā
Don't tag people randomly, even if they seem knowledgeable. Most of the time, the person you tagged doesn't even know about the topic you just brought up. If people want to help you, they will - just be patient.
Alex
Yes, in index file
use media url and keep looping using javascript in front end
saman
Can you tell a site that teaches Django like w3?
Faraaz
I am making a contact form in django and when I fill the form I am getting this integrity error
Neo
I am making a contact form in django and when I fill the form I am getting this integrity error
There's probably a field with a unique constraint in the model
Neo
or even a field that is not nullable
Faraaz
Send error
https://linkode.org/#Ftv7TeECghLSsJEV6xTy67
Neo
https://linkode.org/#Ftv7TeECghLSsJEV6xTy67
Read the error brother. It clearly says what is wrong
Neo
field name in home_contact is not nullable yet receives a None value when inserting and hence the error
Faraaz
I already did null=True in the fields
Neo
did you migrate after that?
Neo
Either way lets see your form and model
Alexey
I already did null=True in the fields
add both null=True, blank=True
Faraaz
Yeaah it worked actually when I migrated it after adding null and blank true then it worked thanks
Neo
blank=True is for the admin panel i believe
Stealth
how do i get the numbers from the field in view. I want to perform operations with these fields, but I get an error about unsupported operands for QuerySet http://linkode.org/#o9NlHu7dCDoJ0vKS5o0dn6
Stealth
Do you iterate via num, num2? values() returns a list of dicts. num/num2 will not work
is there a ready method? Or do you need to write your own iteration?
Alexey
num returns something like <Queryset[{"num":1}, {"num":2}....]> you can iterate over queryset for n in num: do something with n["num"]
Dmitry
!ol
Doragonsureiyā
Python groups in other languages (‼️ Not managed by us ‼️) Amharic @python_amharic Arabic @arabipython Azerbaijani @azepug Chinese @pythonzh French @python_francais German @pythonde Hebrew @pythonisrael Hindi @pyindianew Indonesian @pythonid Italian @python_ita @pythonita Kazakh @python_kz Malaysia @pythonmalaysia Persian @pyfarsi Portuguese @pythonbr Russian @ru_python_beginners @ru_python @python_scripts Spanish @PythonEsp Swahili @python_eafrica Turkish @python_tr Uzbek @python_uz If you have an (active) group you want to add, ask in the meta group, link in the rules page.
Samvel
I want to modify this tag in django admin page , how can i do it
Samvel
Select t antennas to change
Anonymous
relation "django_admin_log" does not exist i am getting this error when i changed database to postgres
Alex
how do i get the numbers from the field in view. I want to perform operations with these fields, but I get an error about unsupported operands for QuerySet http://linkode.org/#o9NlHu7dCDoJ0vKS5o0dn6
iterate over querysets to access or modify data. if you want to play around, use >python manage.py shell .... it will provide a better understanding.
~ N
Value error Cannot assign “”: “” must be a “” instance
~ N
How o fix itt !!!
Alex
Value error Cannot assign “”: “” must be a “” instance
foreign key relation requires instance.id which is missing
Neo
Yes i did
bro chill i wasn't talking to you
~ N
foreign key relation requires instance.id which is missing
Its a foreign key problem but i don’t know where is the problem exactly
~ N
bro chill i wasn't talking to you
🤣🤣🤣🤣🤣 sorry
~ N
Model
~ N
view
Alex
use pastebin or linkode for sharing code
Alex
also what request/view triggers error?
~ N
https://pastebin.com/bmbhCTi4
Alex
Which one ?
instance one
~ N
ok
~ N
ValueError at /expense/edit-expense/4 Cannot assign "'Transfer'": "Expense.category" must be a "Category" instance.
~ N
on the edit and the add expense
Alex
>category = request.POST['category'] replace with >category=Category.objects.get(category=request.POST['category'])
~ N
ProgrammingError at /expense/add-expense column expense_category.category does not exist LINE 1: SELECT "expense_category"."id", "expense_category"."category...
~ N
another error
~ N
fixxxx ittt !! thank u Alex
Alex
you can reduce your entire code to half by using CBV and model form
Alexey
Has someone an idea for this issue? Thanks
Shift.depot.through.bulk_create() ?
Patrick
Bit I'll need shift's ID?
Alexey
yep, shift and depot id or instances.
Patrick
Ok, so I have to left bulk_update_or_create, because It doesn't return id of each updated/created objects
Patrick
What is then the ideal alternative to bulk update/create?
Patrick
Is there an alternative to this: https://stackoverflow.com/a/66322489 ?
Vishnu
Hi all, I'm starting django from next week. Anyone up for group study? Please dm me if interested.
Shazam_
Is there any way to automatically delete image of user when the user gets deleted. Right now if I delete a user his image still exists in database!!!
Fan / Ac
Rushikesh
Want to implement message broadcast to multiple clients api using fastapi, Can anyone suggest any module or fastapi thing??
Charly
Ok, working with websockets?
Yeah that's possible
Михаил
Hi! How i can use dir "media" like "templates"?
Tensor
Set template directory in settings.py
Alex
Mirco
yes, remove the other ones
Михаил
Hi. How i can creat automatically paste request.user to form.
Михаил
I want to create posts
Михаил
By users
Михаил
I want to use cCreateView
Alex
use form_valid... and there modify the filed of form.
Михаил
Ok