Opeyemi
Should i create a new model for choices?
i just showowed 2 examples, hope it helps
Ильяс
Yeah i already finished the problem)) Thanks
Siddhesh
Siddhesh Sawant: Hey i have a doubt See im filling form.. Take e.g. email and address are field.. So what i want is after user click submit while registeration e-mail will go in User model Address will go in Profile model Currently i can save data in User model.. And also can generate instace of that particular user. In Profile Table.. But with address empty in column It jst create user id in Profile all other fields are null
Pushpender
#Help i am developing a movie site for acedemic project. i am having dificulty in creating models for genre . i want to make a genre field in which i can store multiple genre. how can i do it
Pushpender
yup i just don't know where to start, i have already create a genre choice field
Pushpender
i want to make a field where i can store multiple genre for each movie. some movies can have 3 genres while others can have more or maybe less than 3 genres
Opeyemi
i think because there are alot of genres, the better solution is to make it a foreign field
Gaurav
i think because there are alot of genres, the better solution is to make it a foreign field
Can you please elaborate..when we should define a foreign field?
Opeyemi
class Genre(models.Model): name = models.CharField(max_length=300) class Music(models.Model): user = models.ForeignKey("Genre", on_delete=models.CASCADE)
Opeyemi
Opeyemi
thanks bro, will try
that is my reason👆🏿
Opeyemi
maybe there is a better solution i dont know about, bet that is was i was told when i was faced with same issue a while ago
Opeyemi
actually i made a mistake, i was to use many to many field
Opeyemi
thanks bro, will try
bro, i think i made a mistake, i will correct it and update you
Opeyemi
thanks bro, will try
class Genre(models.Model): name = models.CharField(max_length=300) class Music(models.Model): genre = models.ManyToManyField(Genre, on_delete=models.CASCADE)
Opeyemi
thanks bro, will try
that is what it should look like 👆🏿
Anonymous
before that, why does name field contain max_length of 300 char??
Opeyemi
before that, why does name field contain max_length of 300 char??
i took the code from a project i was building, there i waned a bio field, and wanted to restrict the length of the text
Anonymous
Note If you are writing an application that must be portable to multiple database backends, you should be aware that there are restrictions on max_length for some backends. Refer to the database backend notes for details.
Anonymous
some db backends restrick max_length on CharField to 256. If you do that in production you might endup running into trouble at some point
Damron
Hi guys! Is there opportunity to see which commands are used when we trying to Model.objects.filter(...) I mean what's command string is sent to the database to get suitable rows?
Damron
It's hard to understand quickly
Damron
)
raven
ohh you can try printing this print( Model.objects.filter().query)
Ananthu
am trying to integrate js frontend frame work to django, trying django to serve the files. Is there a work around for manually addding {%load static%) to files
Ananthu
django2.2 and angular 8
Ananthu
any one done this before?
Katia
What's the best way to create an interactive floormap for a django web app ? Thanks
Anonymous
I got rest_framework to work but i have trouble django serve angular files
Why dont you put your angular in yoursite.com and your rest_framework in api.yoursite.com?
Anonymous
I dont think that is the best practice. Sorry, i dont have any solution for this
Anonymous
Any django
Anonymous
Interview questions for fresher and experience
Anonymous
Anonymous
Any PDF format is thr??
Anonymous
Any PDF format is thr??
There are slides from Edureka
Anonymous
Is it
Anonymous
Is that link with u
Raph
could anyone help me here please... Why am I getting this error when trying to install Pillow: Command "C:\Users\Raph\PycharmProjects\Django_Lectures\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\\Users\\Raph\\AppData\\Local\\Temp\\pip-install-j18_xkhk\\Pillow\\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace ('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Raph\AppData\Local\Temp\pip-record-8kvrsjrk\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Raph\PycharmProjects\Django_Lectures\venv\ include\site\python3.8\Pillow" failed with error code 1 in C:\Users\Raph\AppData\Local\Temp\pip-install-j18_xkhk\Pillow\
Anonymous
What is context in django
Raph
what do you mean?
Anonymous
Question
Anonymous
Django and machine learning anyone has done
professor
I am trying to make my activation url like activate/096715d5a428c3d84dd142711f025d68963cc45ec29d4ddd8007506e00af13a3/ . my origial url looks like path('activate/<slug:uidb64>/<slug:token>/', views.activate, name='activate') , and I tried to remove <slug:uidb64> it doesnt work any tips to achieve this?
Feisal
Should i create a new model for choices?
No put it on the profile models as Class UserProfile(models.Model): GENDER_CHOICE= ("m","Male") ("f","Female") ("fns","Prefer not to say")
Human
Guys I am a beginner in Django ....I am creating a practice site for uploading image .....but the images are not showing on Django admin....why ?????
Human
Not is shown there
Human
It also show to choose file
Ghorz
Can you please elaborate..when we should define a foreign field?
Foreign key is a dependency/relationship. In a bank, your foreign could be your account number (primary key as well). It reference other information pertaining to you. Please do some sql, it will be helpful.
Ghorz
Guys I am a beginner in Django ....I am creating a practice site for uploading image .....but the images are not showing on Django admin....why ?????
Yea. That's by default. Be sure to make django serve static files on debug==True for development
professor
Ghorz
I fix it already
Okay if its login/sign up. Use django allauth
professor
Okay if its login/sign up. Use django allauth
I will use it for social login not traditional one
Ghorz
It's customizable
professor
is it possible to allow specific domain mail in django?
Ghorz
You can modify it to your taste
professor
Yes
do you have an example how can I?
professor
example if I want only gmail or hotmail users use this feature