Skip to content

Instantly share code, notes, and snippets.

@lightstrike
Created June 8, 2016 23:20
Show Gist options
  • Save lightstrike/2f32fac2a3d1ee75a7f7e7184f04336b to your computer and use it in GitHub Desktop.
Save lightstrike/2f32fac2a3d1ee75a7f7e7184f04336b to your computer and use it in GitHub Desktop.
Student Record Brainstorming
class StudenAdmin(admin.ModelAdmin):
inlines = (StudentRecordInline,)
class Student(models.Model):
admin_grade = models.IntegerField(null=True)
hq_grade = models.IntegerField(null=True)
class StudentRecord(models.Model):
student = models.ForeignKey(Student) # things like ID, maybe what camp they're attending
RECORD_TYPES = ('headquarters', 'admin', 'master')
record_type = models.CharField(choices=RECORD_TYPES)
grade = models.IntegerField()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment