Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • R roomlist
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 23
    • Issues 23
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • SRCT
  • roomlist
  • Issues
  • #53

Closed
Open
Created Nov 18, 2015 by Daniel W Bond@dbond2Developer

rehaul initial building/floor/room generation script

suggested specs:

two input files:

buildings and floors, buildings and rooms

as you iterate through the first file, create building on string, create a floor related to that building on number

for the second file, on string, find the associated building, then match the subsequent rooms to the building's floor based on the starting digits of the room number

I'll leave it up to you whether you want to create a json file or directly i/o with the database

example stuff to look at:

the models in question https://git.gmu.edu/srct/roomlist/blob/master/roomlist/housing/models.py

input example https://git.gmu.edu/srct/roomlist/blob/master/roomlist/housing/room-numbers

json generation https://git.gmu.edu/srct/roomlist/blob/master/roomlist/housing/room-numbers.py

final json output https://git.gmu.edu/srct/roomlist/blob/master/roomlist/housing/initial_data.json

or alternatively, writing to the database: https://git.gmu.edu/srct/roomlist/blob/master/roomlist/accounts/demo_users.py

json is basically just a big ol' dictionary

outside docs:

Django on fixtures: https://docs.djangoproject.com/en/1.8/howto/initial-data/#providing-initial-data-with-fixtures

python file input and output: https://docs.python.org/2/tutorial/inputoutput.html

parsing json with python: https://docs.python.org/2/library/json.html

Assignee
Assign to
Time tracking