Actually you can refer to one to many relation model.
Its like one user has multiple address
Or
One adress has multiple users.
In models file.
You can make changes.
Like
For 1 user multiple address
Eg:
Class User(models.Model):
User_name= models.Charfield()
Class address(models.Model):
Adressss=model.ForeignKey(User, on_delete=models.CASCADE)
On Fri, Aug 9, 2019, 02:36 göktürk sığırtmaç <[email protected]> wrote:
> Hi, I'm developing app with django. I have users module. My database
> schema users table and address table. Address table have foreign key from
> users table. Now how can compose app architecture? Should i new module as
> address and i should put address model etc. or Should i write address table
> in users model? Does second choose violate single responsibility principle.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/91e6ab67-868b-4f83-a2da-6a04646a97b0%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/91e6ab67-868b-4f83-a2da-6a04646a97b0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/CAAB4E736Xwbzfe-ypFxcsM2jhex-J%2BOUvqbsoYtr%2B01nm2NsxA%40mail.gmail.com.