Created
August 18, 2017 07:20
-
-
Save hassanabidpk/b0affaddf9652e1d13086eb46e2536fd to your computer and use it in GitHub Desktop.
Pycon Lunch Model
This file contains hidden or 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
from django.db import models | |
from django.contrib.auth.models import User | |
class Restaurant(models.Model): | |
name = models.CharField(max_length=200) | |
address = models.TextField() | |
photo = models.ImageField(upload_to="food/photos/", null=True, blank=True) | |
menu = models.TextField() | |
tags = models.CharField(max_length=200) | |
pub_date = models.DateTimeField(auto_now_add=True) | |
writer = models.ForeignKey(User) | |
def __str__(self): | |
return self.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment