cj
or make another model of just an ImageField and make a ManyToOne relation to it
Rajab
cj
https://docs.djangoproject.com/en/2.2/topics/db/examples/many_to_one/
Vachagan Muradyan
Thank you
S
Kaushal
I have a model named "mydatabase" which is related with "user" model using OneToOne. I have stored "password" and "username" in "User" model and "location" and "bloodgroup" in "mydatabase" model. Now I am creating profile in profile.html file. How can I send "username" and its consecutive "location" to profile.html? I am new to django so please guide me...
Vachagan Muradyan
Plese send me some projects that include that arrayfield
Vachagan Muradyan
If it is not hard for you
Kaushal
"Username" and its respective "location"
Vachagan Muradyan
Please send me direct example of that project
Vachagan Muradyan
In zip form
cj
🙄 I don't know if you're being serious with that
cj
Vachagan Muradyan
I am too serious
Vachagan Muradyan
Please send me project that include that multiply image adding in model, dm, in zip form
cj
cj
is google forbidden to use for you?
Anonymous
How to access mysql in Django?
Anonymous
Vachagan Muradyan
I can,t find
drunktimelord
cj
cj
you can use any other —supported— DB just by installing the proper driver/connector (and of course installing or having access to that DB engine/server)
cj
drunktimelord
👀
Anonymous
cj
cj
Kaushal
cj
Xamppp server**
if you're thinking on using XAMPP and Django, you'd better stop right now
Kaushal
drunktimelord
drunktimelord
what's the command for this
Anonymous
Anonymous
cj
So sqlite is good by default db
it's enough for simple things... depends a lot on what you want to do.
take in mind that Django performs better —really better— with PostgreSQL
Pruthvi
Friends iam getting error as
"windows djangwindowso admin is not recognized as an internal or external command"
cj
Pruthvi
Sry "windows 'django-admin' is not recognised as an internal or external command"
drunktimelord
Pruthvi
Everytime iam getting this while cmd django-admin startproject
Pruthvi
Project name
Pruthvi
Kaushal
again I want to search users using "location" which is in "mydatabase"model. I want to get the "username" and "email" of the users from "User" model which is connected to "mydatabase" using OneToOne. How can I do that?
cj
cj
depends on what name you wrote to the field you're using to make the relation between the models
Kaushal
Okay I will try
Sushanth
Hello all
Sushanth
Can anyone suggest me good sources for learning django
Kaushal
Anonymous
https://www.justdjango.com/articles/build-an-api-with-django
I just read Build an API with Django. Check it out here:
cj
Andrew
Ребята подскажите как снюхать
class Post:
...
category = models.ForeignKey('name', on_delete=models.PROTECT, verbose_name='Категория')
class Category(models.Model):
name = models.CharField(max_length=255)
из класса Category в класс Post надо добавить name категории
Anonymous
Hi
Anonymous
How retrieve the saved form data in a webpage by using django?
Aamin
Anonymous
Saved in database
Anonymous
How retrieve the saved form data in a webpage by using django?
In views.py
1) import yourModleName
2)get the objects from model
datas=yourModelName.objects.all()
return render(request,'templateName.html',{'datas':datas}
3) set it in your html template
{% for data in datas %}
<p>{{data}}</p>
{% endfor %}
Aamin
Saved in database
I'd it's the database you know where your data is saved when the the form is saved. You yourself create the views which interact with forms to save the data onto the desired models. Backtrack from forms.py to views.py to find the models.py where the data is stored, query the required models to get the desired results.
Viktor
hello! has anyone worked with django-guardian or django-rules packages? which one is better?
Abhi
I want to make game of chess using Django.
Abhi
So It can be possible
Abhi
because i am new in Django
Сергей
hello, if I applied delete on queryset and termainate it by crt + c in shell befor it done and show result of deleted, deleted in this case any fk that deleted model realted or not?
Anonymous
What is the difference between OneToOneField and ManyToManyField anyone plz?
Anonymous
🧩
Hi, who could help me? I have a problem. Only registered users can comment posts on site (for unregistered works, I commented it), but i don’t know what’s wrong with this one. My code: https://gist.github.com/aleksandrlozko/fa5b10e1368d89d1ac645b5cbf11e260
Андрей
Hi, anyone know how to exclude models description from swagger page degenerated by drf-yasg
🧩
request import from which lib?
🧩
doesn’t work