Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issue #21: Add a held position table to the database #30

Merged
merged 1 commit into from

1 participant

@rogerskw
Owner

No description provided.

@rogerskw rogerskw merged commit ebf0a7d into master
@rogerskw rogerskw deleted the iss21 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 6, 2014
  1. @rogerskw
This page is out of date. Refresh to see the latest.
Showing with 24 additions and 2 deletions.
  1. BIN  db.sqlite3
  2. +4 −2 info/admin.py
  3. +20 −0 info/models.py
View
BIN  db.sqlite3
Binary file not shown
View
6 info/admin.py
@@ -1,6 +1,6 @@
from django.contrib import admin
-from info.models import PledgeClass, Brother, Department, Major, HasMajor, Officer
+from info.models import PledgeClass, Brother, Department, Major, HasMajor, Officer, HeldPosition, Position
# Register your models here.
@@ -9,4 +9,6 @@
admin.site.register(Department)
admin.site.register(Major)
admin.site.register(HasMajor)
-admin.site.register(Officer)
+admin.site.register(Officer)
+admin.site.register(HeldPosition)
+admin.site.register(Position)
View
20 info/models.py
@@ -90,6 +90,26 @@ def __unicode__(self):
def __str__(self):
return self.__unicode__()
+class Position(models.Model):
+ name = models.CharField(max_length=50)
+
+ def __unicode__(self):
+ return self.name
+
+ def __str__(self):
+ return self.__unicode__()
+
+class HeldPosition(models.Model):
+ brother = models.ForeignKey(Brother)
+ position = models.ForeignKey(Position)
+ year = models.IntegerField()
+ semester = models.CharField(max_length=50)
+
+ def __unicode__(self):
+ return " ".join([str(self.year), self.semester, str(self.brother), str(self.position)])
+
+ def __str__(self):
+ return self.__unicode__()
class BrotherEntity():
def __init__(self, brotherObj):
Something went wrong with that request. Please try again.