---
title: "Discussion on \"Django Models Part 2 (Models Relationship)\" | Hashnode"
description: "Discussion on \"Django Models Part 2 (Models Relationship)\". Table relationships in Relational Database design\n1.  One to One relationship (1-1)\n\nA relation is said to be 1-1 if a row in Table A can have only one matching row in Table B\nLet's take an example of simple 1-1 relationship between user and user_det..."
url: "https://hashnode.com/posts/django-models-relationship/623b46bbe99839749d24812c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Django Models Part 2 (Models Relationship)](https://djangotherightway.com/django-models-relationship?utm_source=hashnode&utm_medium=feed)

Table relationships in Relational Database design 1. One to One relationship (1-1) A relation is said to be 1-1 if a row in Table A can have only one matching row in Table B Let's take an example of simple 1-1 relationship between user and user\_det...

Mar 23, 2022 · 6 min read · djangotherightway.com  
Updated May 26, 2022  
Read the article

-   [#django](https://hashnode.com/tag/django)
-   [#databases](https://hashnode.com/tag/databases)

## Written by

[Django The Right Way](https://hashnode.com/@pydj)

@pydj

  
[View profile](https://hashnode.com/@pydj)

Django The Right Way

## Responses 1

Markdown supported · ⌘↵ to post

[islam kamel](https://hashnode.com/@islamkamel)

[May 24, 2022](https://hashnode.com/posts/django-models-relationship/623b46bbe99839749d24812c/comment/628cf9bebc26026fa45c45b6)

> Let's implement (1-M) relation on Django (ForeignKey)

```
from django.db import models

class Address(models.Model):
    .....
    .....
    ..... 

class User(models.Model):
    .....
    .....
    ..... 
    address = models.OneToOneField(Address, on_delete=models.CASCADE)
```

I think you need to change that line `address` To be ForeignKey instead of OneToOne

[Django The Right Way](https://hashnode.com/@pydj)

[May 26, 2022](https://hashnode.com/posts/django-models-relationship/623b46bbe99839749d24812c/comment/628cf9bebc26026fa45c45b6#reply-628f8c799a7f929c55a4283a)

Thank You for the feedback. I have updated the post.
