Anonymous
nope
Cesar
do this... ./manage.py shell on that shell type this from pages.model import *
Cesar
send the output of dir(Patient)
Cesar
are you sure you have this line in your Patient 's model? user = models.ForeignKey(User,on_delete=models.CASCADE)
Cesar
and file is saved?
Anonymous
and file is saved?
oh,I commented it for making the code running ..my mistake
Cesar
there it is... delete that message please, too long
Cesar
now makemigrations and migrate
Cesar
it probably will tell you you need a default user
Cesar
just use 1 as default
Anonymous
Anonymous
still same error.. when going into admin and click on patient still its showing error no such column: pages_patient.user_id
Cesar
Use pastebin.com or any paste service out there
Anonymous
Hi guys
Anonymous
Need some help
Anonymous
https://stackoverflow.com/questions/60844054/how-can-i-reference-foreignkey-in-django-to-populate-a-pedigree-sheet
Presence
Can anyone please link good tutorial for authentication using simplejwt...
Anonymous
your problem is with the migrations
should I try deleting migration folders
Cesar
grandgrand should be {{ porumbel.tata.mascul.tata.mascul.tata.mascul }}
Anonymous
@ceterre It doesn't work
Anonymous
I've tried this before
Cesar
what error does it throw?
Anonymous
No error
Cesar
forget about the template, try it in a shell
Cesar
wait, are you sure the one you are looking for, has a grandfather?
Anonymous
Yes, it has
.
Please help me , who knows how to solve this problem ?
.
Cannot set up a python SDK at Python 3.8 (env) (2) (C:\Users\Аскар\Desktop\WebDevelopment\WD2020\Week9\env\Scripts\python.exe). The SDK seems invalid.
AJ
Hi everyone, So I have a model of events and they have levels 1,2,3 now I want am using listview paginated by 10 objects per page but how do I make sure level 3 objects are always above 2 and level 2 above 1. While all being randomized in every refresh, I'm unable to find any answer on this. Any help is appreciated. Thankyou in advance.
Cesar
Yes, it has
sorry but i dont trust you 😅😅
Cesar
just did the test
Anonymous
I'm new to django
Anonymous
How can I activate django shell to print that out?
Anonymous
I'm using pycharm
Anonymous
@cult_of_kosmos no module named ..
Anonymous
your problem is with the migrations
resolved ,Thanks .. only things now that I need to change now is how to add data without manually selecting user from the dropdown in forms
Cesar
I'm using pycharm
shell should be around (tools -> manage.py task -> shell)
Anonymous
@ceterre I get it but says no module named porumbel
Anonymous
Even if I imported the views
Cesar
what exactly are you doing in the shell?
Anonymous
@ceterre Testing {{ porumbel.tata.mascul }}
Cesar
on shell..... you cannot call porumbel
Cesar
😐
Anonymous
Then?
Cesar
do you have the id or name of an object that should have grand father?
Anonymous
Yes
Cesar
do this on the shell from APPNAMEHERE.models import *
Cesar
then get the object by the id or name whatever... obj = Porumbei.objects.get(id=XXXXXXXX) then you should be able to check the father with obj.tata.mascul
Cesar
Yes
🙄
Anonymous
It gets the father
Anonymous
But wehen I run obj.tata.mascul.tata.mascul
Anonymous
'NoneType' object has no attribute 'mascul'
Cesar
thats because it doesnt have a grand father
Anonymous
The obj has grandfather from here mother
Anonymous
I run {{ obj.mama.femela.tata.mascul }}
Cesar
Thas another story.....
Anonymous
And it worked
Cesar
what exactly do you expect it to return on father's side grand-father if it doesnt have any?
Anonymous
You're right
Anonymous
Did not type corect the variable
Anonymous
Thank you for your patience
Cesar
👍🏽
[ 𝕂𝕣𝕒𝕦𝕤𝕖 ]
Hi, everybody. What can I specify in redirect (or not here) so that after switching to the specified directory (for example, to admin) and after successful authorization, the user goes to the root directory of the project?
[ 𝕂𝕣𝕒𝕦𝕤𝕖 ]
User starts the project: -> /maindir Me: redirect him to /admin User: enters login/password Me: redirect him to /maindir
[ 𝕂𝕣𝕒𝕦𝕤𝕖 ]
this is my application's logic. I'm using django for my personal purposes
[ 𝕂𝕣𝕒𝕦𝕤𝕖 ]
yes
[ 𝕂𝕣𝕒𝕦𝕤𝕖 ]
🙃
Shihasz
yes
You may need to subclass django default admin site and template