-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
권아림
committed
Jul 26, 2024
1 parent
2014ef3
commit 4c2a6cc
Showing
8 changed files
with
253 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Generated by Django 4.2.14 on 2024-07-26 14:19 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
|
||
dependencies = [ | ||
("users", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Friend", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("state", models.CharField(blank=True, max_length=20, null=True)), | ||
( | ||
"friend", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="friend_of", | ||
to="users.user", | ||
), | ||
), | ||
( | ||
"user", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="friends", | ||
to="users.user", | ||
), | ||
), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
# from django.db import models | ||
from django.db import models | ||
from users.models import User | ||
|
||
# Create your models here. | ||
|
||
|
||
class Friend(models.Model): | ||
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="friends") | ||
friend = models.ForeignKey(User, on_delete=models.CASCADE, related_name="friend_of") | ||
state = models.CharField(max_length=20, null=True, blank=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Generated by Django 4.2.14 on 2024-07-26 14:19 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
|
||
dependencies = [] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Restaurant", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("name", models.CharField(max_length=255)), | ||
( | ||
"rating_naver", | ||
models.DecimalField( | ||
blank=True, decimal_places=2, max_digits=5, null=True | ||
), | ||
), | ||
( | ||
"rating_kakao", | ||
models.DecimalField( | ||
blank=True, decimal_places=2, max_digits=5, null=True | ||
), | ||
), | ||
( | ||
"rating_google", | ||
models.DecimalField( | ||
blank=True, decimal_places=2, max_digits=5, null=True | ||
), | ||
), | ||
("address", models.CharField(max_length=255)), | ||
("latitude", models.DecimalField(decimal_places=7, max_digits=10)), | ||
("longitude", models.DecimalField(decimal_places=7, max_digits=10)), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
# from django.db import models | ||
from django.db import models | ||
|
||
# Create your models here. | ||
|
||
|
||
class Restaurant(models.Model): | ||
name = models.CharField(max_length=255) | ||
rating_naver = models.DecimalField( | ||
max_digits=5, decimal_places=2, null=True, blank=True | ||
) | ||
rating_kakao = models.DecimalField( | ||
max_digits=5, decimal_places=2, null=True, blank=True | ||
) | ||
rating_google = models.DecimalField( | ||
max_digits=5, decimal_places=2, null=True, blank=True | ||
) | ||
address = models.CharField(max_length=255) | ||
latitude = models.DecimalField(max_digits=10, decimal_places=7) | ||
longitude = models.DecimalField(max_digits=10, decimal_places=7) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Generated by Django 4.2.14 on 2024-07-26 14:19 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
|
||
dependencies = [ | ||
("users", "0001_initial"), | ||
("restaurants", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Review", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("content", models.CharField(max_length=255)), | ||
("recommend_count", models.IntegerField()), | ||
("decommend_count", models.IntegerField()), | ||
("parent_id", models.IntegerField(blank=True, null=True)), | ||
("date", models.DateTimeField()), | ||
( | ||
"restaurant", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="restaurants.restaurant", | ||
), | ||
), | ||
( | ||
"user", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="users.user" | ||
), | ||
), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name="Recommend", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("recommend", models.BooleanField()), | ||
( | ||
"review", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="reviews.review" | ||
), | ||
), | ||
( | ||
"user", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to="users.user" | ||
), | ||
), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
# from django.db import models | ||
from django.db import models | ||
from users.models import User | ||
from restaurants.models import Restaurant | ||
|
||
# Create your models here. | ||
|
||
|
||
class Review(models.Model): | ||
user = models.ForeignKey(User, on_delete=models.CASCADE) | ||
restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE) | ||
content = models.CharField(max_length=255) | ||
recommend_count = models.IntegerField() | ||
decommend_count = models.IntegerField() | ||
parent_id = models.IntegerField(null=True, blank=True) | ||
date = models.DateTimeField() | ||
|
||
|
||
class Recommend(models.Model): | ||
user = models.ForeignKey(User, on_delete=models.CASCADE) | ||
review = models.ForeignKey(Review, on_delete=models.CASCADE) | ||
recommend = models.BooleanField() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Generated by Django 4.2.14 on 2024-07-26 14:19 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
|
||
dependencies = [] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="User", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("email", models.CharField(max_length=255)), | ||
("password", models.CharField(max_length=255)), | ||
("nickname", models.CharField(blank=True, max_length=255, null=True)), | ||
("image", models.CharField(blank=True, max_length=255, null=True)), | ||
("reliability", models.SmallIntegerField(blank=True, null=True)), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
# from django.db import models | ||
from django.db import models | ||
|
||
# Create your models here. | ||
|
||
|
||
class User(models.Model): | ||
email = models.CharField(max_length=255) | ||
password = models.CharField(max_length=255) | ||
nickname = models.CharField(max_length=255, null=True, blank=True) | ||
image = models.CharField(max_length=255, null=True, blank=True) | ||
reliability = models.SmallIntegerField(null=True, blank=True) |