Skip to content

Instantly share code, notes, and snippets.

@SpencerCooley
Created September 4, 2016 10:10
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 SpencerCooley/3081fe60de68479e11967c0e9bb5fc99 to your computer and use it in GitHub Desktop.
Save SpencerCooley/3081fe60de68479e11967c0e9bb5fc99 to your computer and use it in GitHub Desktop.
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
def Follow(models.Model):
consumer = models.ForeignKey(
'User',
on_delete=models.CASCADE,
)
producer = models.ForeignKey(
'User',
on_delete=models.CASCADE,
)
def Content(models.Model):
MEDIA_TYPES = (
('photo', 'photo'),
('video', 'video'),
)
user = models.ForeignKey(
'User',
on_delete=models.CASCADE,
)
media_type = models.CharField(max_length=1, choices=MEDIA_TYPES)
thumb = models.FileField(upload_to='content/', blank=True)
message = models.CharField(max_length=200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment