Skip to content

Instantly share code, notes, and snippets.

@sixthgear
Created June 18, 2010 07:35
Show Gist options
  • Select an option

  • Save sixthgear/443371 to your computer and use it in GitHub Desktop.

Select an option

Save sixthgear/443371 to your computer and use it in GitHub Desktop.
class Language(models.Model):
name = models.CharField(max_length=100)
def __unicode__(self):
return self.name
class Solution(models.Model):
problem = models.ForeignKey(Problem)
author = models.ForeignKey(User)
title = models.CharField(max_length=100, blank=True)
submitted = models.DateField(auto_now_add=True)
def __unicode__(self):
return self.title
class File(models.Model):
solution = models.ForeignKey(Solution)
language = models.ForeignKey(Language)
filename = models.CharField(max_length=50)
source = models.TextField()
def __unicode__(self):
return self.filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment