| #summary Url scheme in melange | |
| #labels Contents-Skeleton | |
| <wiki:toc max_depth="2" /> | |
| = What does a URL look like? = | |
| Example: /*gsoc*/*org*/*home*/*google*/*gsoc2013*/*melange* | |
| * The first path component is considered the “module”, some examples. | |
| * */gsoc* are the Google Summer of Code related urls | |
| * */gci* are the Google Code-in related urls | |
| * */tasks* are all the Google Appengine TaskQueue related URLs, these are followed by another component to indicate which module they belong to. All urls starting with /tasks can only be hit by a AppEngine developer or an internal AppEngine generated request. | |
| * Second is “component”, this indicates the different items and concepts in Melange. This component might consist out of multiple parts. Examples are: | |
| * */dashboard* the dashboard for users | |
| * */home* the homepage of the program | |
| * */document* any documents in the program | |
| * */admin* the administration pages for Hosts | |
| * */org/application* organization applications | |
| * Third is “function” or “action”, such as | |
| * */edit* | |
| * */show* | |
| * */create* | |
| * */update* | |
| * Fourth path component is ID, keyname, or enough of the key name to unambiguously identify the viewed entity. E.g. | |
| * */google/gsoc2013/melange* | |
| == Module Component == | |
| Melange knows three module components: | |
| # gsoc, Google Summer of Code programs | |
| # gci, Google Code-In programs | |
| # core, general site-wide configuration and pages are handled here. Core pages do not have a module component in the url. | |
| == Components component == | |
| == Action component == | |
| * Under what conditions does function/action appear? If it’s a document, “edit” and “show” will probably appear... but there’s not really consistent criteria | |
| == Identifier component == | |
| = How to define a URL in the code? = | |
| * Common patterns live in url_patterns.py | |
| * URLs are registered with DjangoUrlPatterns during frontend instantiation | |
| * See each module’s callback.py module | |
| = Conventions around GET parameters = | |
| * Get parameters are used for things like telling the user that their form was saved correctly | |
| * GCI uses Get parameters to determine action in task view. |