Skip to content

Instantly share code, notes, and snippets.

@codeboy101
Created October 22, 2016 12:18
Show Gist options
  • Select an option

  • Save codeboy101/9268542f3166351037a99def4a875f76 to your computer and use it in GitHub Desktop.

Select an option

Save codeboy101/9268542f3166351037a99def4a875f76 to your computer and use it in GitHub Desktop.
from django.db import models
class Story(models.Model):
title = models.CharField(max_length=75)
body = models.TextField()
rating = models.IntegerField(default=0)
def __str__(self):
return self.title
class UserActs(models.Model):
voters = models.ManyToManyField(Story)
def __str__(self):
return self.voters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment