Naynesh
Create an application that has two apps.
1. User with user and Post model
User : first_name, last_name, email, password, username
Post : user, text, created_at, updated_at
Foreign key relationship exists between User and Post on Model level not on Database level.
2. Products app with Product model.
Product : name, weight, price, created_at, updated_at
Both of the apps should use two different databases.
Create a form that an authenticated user can use to create a post.
Note: Register all models on admin dashboard.
cj
Anonymous
Hi buddies I am beginner to Django, anyone can help me how to use Mongodb Database on Django
Naynesh
Create an application that has two apps.
1. User with user and Post model
User : first_name, last_name, email, password, username
Post : user, text, created_at, updated_at
Foreign key relationship exists between User and Post on Model level not on Database level.
2. Products app with Product model.
Product : name, weight, price, created_at, updated_at
Both of the apps should use two different databases.
Create a form that an authenticated user can use to create a post.
Note: Register all models on admin dashboard.
How to generate this app
Naveen
cj
Create an application that has two apps.
1. User with user and Post model
User : first_name, last_name, email, password, username
Post : user, text, created_at, updated_at
Foreign key relationship exists between User and Post on Model level not on Database level.
2. Products app with Product model.
Product : name, weight, price, created_at, updated_at
Both of the apps should use two different databases.
Create a form that an authenticated user can use to create a post.
Note: Register all models on admin dashboard.
nice homework, sadly we don't do homework here, if you want help, at least show you made some effort and show the code you've written so far
Naynesh
Anonymous
Mirco
cj
Anonymous
PostgreSQL
Thanks again. Do you mind recommend me any books or sites which are best for you?
cj
Anders (izzno / gooood) 🇳🇴
startpage.com
Anders (izzno / gooood) 🇳🇴
^ still not dead ;)
Pogos
Hi, i have macbook. And i wanna create django project, but terminal showed me message "command not found: django-admin"
Pogos
Sorry for my English )
George
Pogos
George
Pogos
no
George
Then you cant use django-admin, as simple as that
cj
learn how to use virtual environments
George
Let me 🦆 DuckDuckGo that for you:
🔎 django-admin not recognized
Pogos
Guys! One more question. I checked version django (terminal show) 1.11.28
Is it normal ?
Eddie
I have data in json that has to be displayed in html table how can i dynamically add another column to that html table and fill it with values based on a condition between two other columns already in the table...is this possible and any advice on how to approach this
George
cj
cj
Pogos
How update vesrion ?
Pogos
)
George
George
And pip
cj
And pip
IIRC he said he's using a Mac, so chances are that he's using Python 2.7 🤷🏻♂️
George
Supernoobuser
What course of Django related with MVC do you recommend me
Vivek
Someone pls tell me ,
What is list view,detail view
Fabian
Someone pls tell me ,
What is list view,detail view
its a generic view in Django, u just past it a model, template and form, List view works for retreiving a list of items of a given model from the BD, detailed, to retrieve details of just one item
cj
Chiranjeevi
I am creating a social media clone. I want to create a post using modelform. My models are Post, PostImage, Comment. A post can have multiple postimages. How do i create a post using modelform?
Anonymous
I read one of conversation and it said mongodb can't be used with django...basically why?like does it work with sql base only or what?
Muflone
Muflone
Maybe with this https://nesdis.github.io/djongo/
Maz
Chiranjeevi
Mirco
Chiranjeevi
class PostForm(models.ModelForm)
I get it but how to create all the post images when creating a post. My postimage has manytoone relationship with post, so for one post i may have to create upto a p postimages.
Chiranjeevi
i have been subclassing modelform and writing code in meta inner classes (only configuration changes)
Mirco
Anonymous
Mirco
Aleksandr
Hey, guys. Anyone used multiple forms like FormView class?
Ярик
hey guys, need your help
i have 2 objects:
— 1st one —
Model1:
number - charfield
date - datefield
Model2:
number - foreignkey(Model1)
item - charfield
quantity - int
These 2 are created by inline form
— 2nd one —
Model3:
invoice - charfield
invoice_date - datefield
number - foreignkey(Model1)
Model4:
invoice - foreignkey(Model3)
item - foreignkey(Model2)
quantity - int
they have to be created by inlineformset too
the logic is following:
1) i create Model1 post where i add Model2 instances (as many as i need) using formset
2) i have to create Model3 post based on Model1 adding Model2 instances and giving them quantity
3) on create - for each Model2 item, the quantity has to be substracted by the quantity of chosen item in Model4
i know that description is big, but i can realize how to implement in and make it work properly
if someone know how to do it, help me pls
Anonymous
Does anyone have django course
Anonymous
Trying to create slide image using bootstrap but I want the image to be uploaded from the admin panel have try using foreignkey but is not given what I want please help
Anonymous
Ярик
how to write an update_or_create method for that model so that if an item exists - increase its quantity?
class ItemSet(models.Model):
dogovor = models.ForeignKey(Dogovor, related_name='itemset', on_delete=models.CASCADE)
item = models.ForeignKey(Items, related_name='itemset', on_delete=models.CASCADE)
quantity = models.PositiveIntegerField()
Doragonsureiyā
Does anyone have django course
Looking for Django tutorials? you can follow these three recommended ones:
* Official documentation and tutorial
* Tutorial from MDN
* Tutorial from django-girls
Eleven
I want user to first change his password when logging in for first time. Till it changes password i don't want him to access any other urls. How to do it?
cj
Eleven
add a flag to your custom user model
I have done that when user logins for first time i redirect him to change password url but until it does that he cannot access any other urls of the site.
Eleven
cj
George
cj
v
Hi guys please suggest me tutorials videos to learn django as a beginner
George
Anonymous
Please guys ,how can Iink my website to my telegram channel
Anonymous
How can I add multiple images to a model in admin and use the model in slideshow with bootstrap please help
Julio
Hi people anyone knows how to display in Django admin model create info from another model?
Julio
I need to display a variable for a calculator
Gil
May be your interest
https://docs.djangoproject.com/en/3.0/topics/db/queries/#lookups-that-span-relationships