Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
roomlist
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
roomlist
Commits
5eafbe0a
Commit
5eafbe0a
authored
Oct 12, 2015
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clas object is now graduating_year integer
parent
a0879342
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
29 deletions
+6
-29
roomlist/accounts/models.py
roomlist/accounts/models.py
+5
-2
roomlist/housing/admin.py
roomlist/housing/admin.py
+1
-2
roomlist/housing/models.py
roomlist/housing/models.py
+0
-25
No files found.
roomlist/accounts/models.py
View file @
5eafbe0a
# standard library imports
import
hashlib
from
datetime
import
date
# core django imports
from
django.db
import
models
from
model_utils.models
import
TimeStampedModel
...
...
@@ -11,7 +12,7 @@ from autoslug import AutoSlugField
from
multiselectfield
import
MultiSelectField
from
allauth.socialaccount.models
import
SocialAccount
# imports from your apps
from
housing.models
import
Room
,
Class
from
housing.models
import
Room
class
Major
(
TimeStampedModel
):
...
...
@@ -122,9 +123,11 @@ class Student(TimeStampedModel):
privacy
=
models
.
CharField
(
max_length
=
100
,
choices
=
PRIVACY_CHOICES
,
default
=
FLOOR
)
room
=
models
.
ForeignKey
(
Room
,
null
=
True
,
blank
=
True
)
clas
=
models
.
ForeignKey
(
Class
,
null
=
True
,
blank
=
True
)
major
=
models
.
ForeignKey
(
'Major'
,
null
=
True
,
blank
=
True
)
current_year
=
date
.
today
().
year
graduating_year
=
models
.
IntegerField
(
default
=
current_year
,
blank
=
True
)
# from when first logged in through peoplefinder, stored for later
original_major
=
models
.
CharField
(
max_length
=
50
,
blank
=
True
)
...
...
roomlist/housing/admin.py
View file @
5eafbe0a
# core django imports
from
django.contrib
import
admin
# imports from your apps
from
.models
import
Class
,
Building
,
Floor
,
Room
from
.models
import
Building
,
Floor
,
Room
admin
.
site
.
register
(
Class
)
admin
.
site
.
register
(
Building
)
admin
.
site
.
register
(
Floor
)
admin
.
site
.
register
(
Room
)
roomlist/housing/models.py
View file @
5eafbe0a
...
...
@@ -116,28 +116,3 @@ class Room(TimeStampedModel):
# def __str__(self): # __unicode__ on Python 2
# return self.street
class
Class
(
TimeStampedModel
):
grad_year
=
models
.
PositiveIntegerField
(
null
=
True
,
blank
=
True
)
FRESHMAN
=
'FR'
SOPHOMORE
=
'SO'
JUNIOR
=
'JR'
SENIOR
=
'SR'
OTHER
=
'OR'
YEAR_IN_SCHOOL_CHOICES
=
(
(
FRESHMAN
,
'Freshman'
),
(
SOPHOMORE
,
'Sophomore'
),
(
JUNIOR
,
'Junior'
),
(
SENIOR
,
'Senior'
),
(
OTHER
,
'Other'
),
)
year_in_school
=
models
.
CharField
(
max_length
=
2
,
choices
=
YEAR_IN_SCHOOL_CHOICES
,
default
=
FRESHMAN
)
class
Meta
:
verbose_name_plural
=
'classes'
def
__str__
(
self
):
# __unicode__ on Python 2
return
str
(
self
.
grad_year
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment