Mendel
Mendel
Paste error in
Mendel
Save, post link here
Sultan
Ok thx
Sultan
And sorry again
Sultan
https://del.dog/ciloyajede
Sultan
mix migrtion files
Anonymous
hi every one i have to give the user some ModelMultipleChoiceField() field but the thing i am using this to get the choices queryset=User.objects.all() and i but this in the form and in my template i do {{form}} but the problem is i got this error after i fill all the fields in the form !!
"Cannot assign "<QuerySet [<User: test01>]>": "project.owner_name" must be a "User" instance."
Anonymous
https://del.dog/axijahuhiw.py
George
Anonymous
i used filter but it dose not fix the problem i will try agin
George
You cant put a filter without criteria
George
Just try to run it in shell
George
Also, its not ok to use all() if you override the query, use none()
George
Also you may be mixing Form and ModelForm
George
In ModelForm you dont init manually the fields
George
Use Form i guess
Anonymous
thanks @hyunlee1o
George
Uwu
inchidi
mix migrtion files
most simple way is delete all migration file and your db, then makemigrations and migrate
George
inchidi
nope
George
hmmm
George
i sometimes deleted a wrong migration file but deleting all :)
George
im just cautious
inchidi
inconsistent migration files are what break migration
George
yeah, tru
George
one thing i always thought is how to regen a col i deleted in database MANUALLY
Komang
Roleback first your migrate file and makemigration again
George
hmmm
George
inchidi
i think dump data, delete table and rerun migration best solution when your table and migration files not sync'ed
George
inchidi
if you already fix your migration files
inchidi
inchidi
or manually find one by one wheres the mistake (usually the migration file start with duplicate number)
inchidi
then your next migrate will be fine
George
George
thanks
George
also dumping a table better through shell or using the GUI?
George
*may be a noob question*
George
George
i'll look if there is something for my txt editor
George
George
but the gui is too much eclipse like and a bit buggy
inchidi
yeah true, and its another app, delete via shell probably faster for almost any case
George
George
and some windows just fucking break
Sultan
Sultan
the error in this file https://del.dog/iyiwotefaf.py
Sultan
Take a look please
Sultan
Help me to find the error
George
Sultan
If you can help me read it, it is only 51 lines
George
also i normally don't make myself the migration files so i cant see the problem
George
Sultan
thx bro
George
:/
George
did you write it manually ?
Sultan
inchidi
Thx
you should not put those things there tho. use fixture instead
Sultan
👍🏻
George
inchidi
fixture?
read more about django fixture here
George
inchidi
not always json tho
George
yes, its nice, also you can save a table in a fixture
inchidi
but tbh i hate manage
py dumpdata for backup or work with many data. it give unsorted data so sometimes relationship breaks
inchidi
but maybe its just me that dont know how to really use it. maybe someone here know how to avoid that
George
Krunal
Can someone help me to learn Django?
m