K
K
Kirill2020-03-10 18:59:07
Django
Kirill, 2020-03-10 18:59:07

How to create a table in django on registration?

Each user must have their own table in the database with orders. How can a table be created without changing the models.py file?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arseny, 2020-03-10
@kustiktm_kirill

Each user must have their own row in the users table and one-to-many relationships to orders.

N
noremorse_ru, 2020-03-12
@noremorse_ru

If you do not change models.py, then there will be problems. Each order must have a ForeignKey for the user, write related_name, perform migration, Django will do the rest for you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question