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
f28d4ff8
Commit
f28d4ff8
authored
Nov 20, 2014
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved files into renamed settings directory
parent
0c0eee9e
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
6 additions
and
228 deletions
+6
-228
roomlist/api/admin.py
roomlist/api/admin.py
+0
-8
roomlist/api/models.py
roomlist/api/models.py
+0
-69
roomlist/roomlist/__init__.py
roomlist/roomlist/__init__.py
+0
-0
roomlist/roomlist/admin.py
roomlist/roomlist/admin.py
+0
-3
roomlist/roomlist/migrations/__init__.py
roomlist/roomlist/migrations/__init__.py
+0
-0
roomlist/roomlist/models.py
roomlist/roomlist/models.py
+0
-3
roomlist/roomlist/tests.py
roomlist/roomlist/tests.py
+0
-3
roomlist/roomlist/urls.py
roomlist/roomlist/urls.py
+0
-12
roomlist/roomlist/views.py
roomlist/roomlist/views.py
+0
-63
roomlist/settings/__init__.py
roomlist/settings/__init__.py
+0
-0
roomlist/settings/settings.py
roomlist/settings/settings.py
+6
-1
roomlist/settings/settings.pye
roomlist/settings/settings.pye
+0
-0
roomlist/settings/urls.py
roomlist/settings/urls.py
+0
-0
roomlist/settings/wsgi.py
roomlist/settings/wsgi.py
+0
-0
roomlist/templates/building.html
roomlist/templates/building.html
+0
-42
roomlist/templates/buildings.html
roomlist/templates/buildings.html
+0
-24
No files found.
roomlist/api/admin.py
deleted
100644 → 0
View file @
0c0eee9e
from
django.contrib
import
admin
from
api.models
import
Class
,
Building
,
Address
,
Room
# Register your models here.
admin
.
site
.
register
(
Class
)
admin
.
site
.
register
(
Building
)
admin
.
site
.
register
(
Address
)
admin
.
site
.
register
(
Room
)
roomlist/api/models.py
deleted
100644 → 0
View file @
0c0eee9e
from
django.db
import
models
from
django.contrib.auth.models
import
User
# Create your models here.
class
Class
(
models
.
Model
):
year_int
=
models
.
IntegerField
()
FRESHMAN
=
'FR'
SOPHOMORE
=
'SO'
JUNIOR
=
'JR'
SENIOR
=
'SR'
YEAR_IN_SCHOOL_CHOICES
=
(
(
FRESHMAN
,
'Freshman'
),
(
SOPHOMORE
,
'Sophomore'
),
(
JUNIOR
,
'Junior'
),
(
SENIOR
,
'Senior'
),
)
year_in_school
=
models
.
CharField
(
max_length
=
2
,
choices
=
YEAR_IN_SCHOOL_CHOICES
,
default
=
FRESHMAN
)
def
__str__
(
self
):
# __unicode__ on Python 2
return
self
.
year_int
class
Building
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
100
)
NONE
=
'na'
AQUIA
=
'aq'
RAPPAHANNOCK
=
'ra'
SHENANDOAH
=
'sh'
NEIGHBOURHOOD_CHOICES
=
(
(
NONE
,
'None'
),
(
AQUIA
,
'Aquia'
),
(
RAPPAHANNOCK
,
'Rappahannock'
),
(
SHENANDOAH
,
'Shenandoah'
),
)
neighbourhood
=
models
.
CharField
(
max_length
=
100
,
choices
=
NEIGHBOURHOOD_CHOICES
,
default
=
NONE
)
address
=
models
.
ForeignKey
(
'Address'
)
def
__str__
(
self
):
# __unicode__ on Python 2
return
self
.
name
def
__unicode__
(
self
):
# __unicode__ on Python 2
return
unicode
(
self
.
name
)
class
Room
(
models
.
Model
):
number
=
models
.
IntegerField
()
floor
=
models
.
IntegerField
()
bedA
=
models
.
CharField
(
max_length
=
80
)
bedB
=
models
.
CharField
(
max_length
=
80
,
blank
=
True
)
bedC
=
models
.
CharField
(
max_length
=
80
,
blank
=
True
)
bedD
=
models
.
CharField
(
max_length
=
80
,
blank
=
True
)
building
=
models
.
ForeignKey
(
'Building'
)
def
__str__
(
self
):
# __unicode__ on Python 2
return
self
.
building
.
__str__
()
+
" "
+
self
.
number
.
__str__
()
class
Address
(
models
.
Model
):
street
=
models
.
CharField
(
max_length
=
100
)
zip_code
=
models
.
IntegerField
(
max_length
=
5
)
state
=
models
.
CharField
(
max_length
=
2
)
def
__str__
(
self
):
# __unicode__ on Python 2
return
self
.
street
roomlist/roomlist/__init__.py
deleted
100644 → 0
View file @
0c0eee9e
roomlist/roomlist/admin.py
deleted
100644 → 0
View file @
0c0eee9e
from
django.contrib
import
admin
# Register your models here.
roomlist/roomlist/migrations/__init__.py
deleted
100644 → 0
View file @
0c0eee9e
roomlist/roomlist/models.py
deleted
100644 → 0
View file @
0c0eee9e
from
django.db
import
models
# Create your models here.
roomlist/roomlist/tests.py
deleted
100644 → 0
View file @
0c0eee9e
from
django.test
import
TestCase
# Create your tests here.
roomlist/roomlist/urls.py
deleted
100644 → 0
View file @
0c0eee9e
from
django.conf.urls
import
patterns
,
include
,
url
from
roomlist
import
views
from
django.contrib
import
admin
admin
.
autodiscover
()
urlpatterns
=
patterns
(
''
,
url
(
r
'^$'
,
views
.
index
,
name
=
'index'
),
url
(
r
'^accounts/login/$'
,
views
.
login
,
name
=
'login'
),
url
(
r
'^accounts/logout/$'
,
views
.
logout_view
,
name
=
'logout_view'
),
url
(
r
'^buildings/$'
,
views
.
buildings
,
name
=
'buildings'
),
url
(
r
'^building/(?P<buildingName>[a-zA-Z]+)$'
,
views
.
building
,
name
=
'building'
),
)
roomlist/roomlist/views.py
deleted
100644 → 0
View file @
0c0eee9e
from
django.http
import
HttpResponse
,
HttpResponseRedirect
from
django.shortcuts
import
render
from
django.template
import
RequestContext
,
loader
from
django.contrib.auth.forms
import
AuthenticationForm
from
django.contrib.auth
import
authenticate
,
logout
from
api.models
import
Building
,
Room
# Create your views here.
def
index
(
request
):
template
=
loader
.
get_template
(
'index.html'
)
context
=
RequestContext
(
request
,
{
})
return
HttpResponse
(
template
.
render
(
context
))
def
buildings
(
request
):
building_list
=
Building
.
objects
.
order_by
(
'name'
)[:
5
]
template
=
loader
.
get_template
(
'buildings.html'
)
context
=
RequestContext
(
request
,
{
'building_list'
:
building_list
,
})
return
HttpResponse
(
template
.
render
(
context
))
def
building
(
request
,
buildingName
):
building
=
Building
.
objects
.
get
(
name__iexact
=
''
+
buildingName
)
room_list
=
Room
.
objects
.
filter
(
building__name
=
''
+
building
.
name
).
order_by
(
'number'
)
template
=
loader
.
get_template
(
'building.html'
)
context
=
RequestContext
(
request
,
{
'building'
:
building
,
'room_list'
:
room_list
,
})
return
HttpResponse
(
template
.
render
(
context
))
def
login
(
request
):
# if this is a POST request we need to process the form data
if
request
.
method
==
'POST'
:
# create a form instance and populate it with data from the request:
# check whether it's valid:
username
=
request
.
POST
[
'username'
]
password
=
request
.
POST
[
'password'
]
user
=
authenticate
(
username
=
username
,
password
=
password
)
if
user
is
not
None
:
# the password verified for the user
if
user
.
is_active
:
print
(
"User is valid, active and authenticated"
)
else
:
print
(
"The password is valid, but the account has been disabled!"
)
else
:
# the authentication system was unable to verify the username and password
print
(
"The username and password were incorrect."
)
return
HttpResponseRedirect
(
'/'
)
# if a GET (or any other method) we'll create a blank form
else
:
form
=
AuthenticationForm
()
template
=
loader
.
get_template
(
'login.html'
)
context
=
RequestContext
(
request
,
{
'form'
:
form
,
})
return
HttpResponse
(
template
.
render
(
context
))
def
logout_view
(
request
):
logout
(
request
)
return
HttpResponseRedirect
(
'/'
)
roomlist/
django_project
/__init__.py
→
roomlist/
settings
/__init__.py
View file @
f28d4ff8
File moved
roomlist/
django_project
/settings.py
→
roomlist/
settings
/settings.py
View file @
f28d4ff8
...
...
@@ -11,7 +11,12 @@ https://docs.djangoproject.com/en/1.6/ref/settings/
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import
os
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
))
TEMPLATE_DIRS
=
[
os
.
path
.
join
(
BASE_DIR
,
'templates'
)]
TEMPLATE_DIRS
=
(
os
.
path
.
join
(
BASE_DIR
,
'templates'
),
os
.
path
.
join
(
BASE_DIR
,
'housing/templates'
),
)
STATICFILES_DIRS
=
(
os
.
path
.
join
(
BASE_DIR
,
'static'
),
)
...
...
roomlist/
django_project
/settings.pye
→
roomlist/
settings
/settings.pye
View file @
f28d4ff8
File moved
roomlist/
django_project
/urls.py
→
roomlist/
settings
/urls.py
View file @
f28d4ff8
File moved
roomlist/
django_project
/wsgi.py
→
roomlist/
settings
/wsgi.py
View file @
f28d4ff8
File moved
roomlist/templates/building.html
deleted
100644 → 0
View file @
0c0eee9e
{% extends 'layouts/base.html' %} {% block title %} GMU RoomList
•
Homepage {% endblock %} {% block content %}
<div
class=
"page-header"
id=
"banner"
>
<div
class=
"row"
>
<div
class=
"col-lg-12 text-center"
>
<h1><strong>
GMU
</strong>
ROOMLIST
</h1>
<p
class=
"lead"
>
{{ building.name }}
</p>
</div>
</div>
</div>
<ul
style=
"list-style-type: none"
>
{% for room in room_list %}
<li>
{{ room.number }}
</li>
<li>
<ul>
<li>
{{ room.bedA }}
</li>
{% if room.bedB %}
<li>
{{ room.bedB }}
</li>
{% endif %}
{% if room.bedC %}
<li>
{{ room.bedC }}
</li>
{% endif %}
{% if room.bedD %}
<li>
{{ room.bedD }}
</li>
{% endif %}
</ul>
</li>
{% endfor %}
</ul>
{% endblock %}
roomlist/templates/buildings.html
deleted
100644 → 0
View file @
0c0eee9e
{% extends 'layouts/base.html' %}
{% block title %}
GMU RoomList
•
Homepage
{% endblock %}
{% block content %}
<div
class=
"page-header"
id=
"banner"
>
<div
class=
"row"
>
<div
class=
"col-lg-12 text-center"
>
<h1><strong>
GMU
</strong>
ROOMLIST
</h1>
<p
class=
"lead"
>
Building List
</p>
</div>
</div>
</div>
<ul>
{% for building in building_list %}
<li>
<a
href=
"/building/{{ building.name }}"
>
{{ building.name }}
</a>
- {{ building.address }} {{ building.address.zip_code }}, {{ building.address.state}}
</li>
{% endfor %}
</ul>
{% endblock %}
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