Skip to content

Instantly share code, notes, and snippets.

@hassanabidpk
Created August 18, 2017 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hassanabidpk/b0affaddf9652e1d13086eb46e2536fd to your computer and use it in GitHub Desktop.
Save hassanabidpk/b0affaddf9652e1d13086eb46e2536fd to your computer and use it in GitHub Desktop.
Pycon Lunch Model
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