{"action":"closed","issue":{"url":"https://api.github.com/repos/lobobabysaurus/NewAppearances/issues/2","labels_url":"https://api.github.com/repos/lobobabysaurus/NewAppearances/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/lobobabysaurus/NewAppearances/issues/2/comments","events_url":"https://api.github.com/repos/lobobabysaurus/NewAppearances/issues/2/events","html_url":"https://github.com/lobobabysaurus/NewAppearances/issues/2","id":117708791,"number":2,"title":"Create a display page for Services","user":{"login":"lobobabysaurus","id":11999195,"avatar_url":"https://avatars.githubusercontent.com/u/11999195?v=3","gravatar_id":"","url":"https://api.github.com/users/lobobabysaurus","html_url":"https://github.com/lobobabysaurus","followers_url":"https://api.github.com/users/lobobabysaurus/followers","following_url":"https://api.github.com/users/lobobabysaurus/following{/other_user}","gists_url":"https://api.github.com/users/lobobabysaurus/gists{/gist_id}","starred_url":"https://api.github.com/users/lobobabysaurus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lobobabysaurus/subscriptions","organizations_url":"https://api.github.com/users/lobobabysaurus/orgs","repos_url":"https://api.github.com/users/lobobabysaurus/repos","events_url":"https://api.github.com/users/lobobabysaurus/events{/privacy}","received_events_url":"https://api.github.com/users/lobobabysaurus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-18T23:50:07Z","updated_at":"2015-11-18T23:50:07Z","closed_at":"2015-11-18T23:50:07Z","body":"While I am working on setting up a surrounding template for the page, you can work on creating a specific layout page for services.  There are a bunch of things to do that will work well to get you acclimated once you've completed the Django tutorial\n\nHere is the list of items necessary for this\n\n1) Update the model (services/models.py) to make service_name is no longer the primary key.  It should be converted into a unique key, but have a random id as the Primary Key.  Issue is I forgot you cannot modify primary keys once they have been set.  Feel free to add any other fields as you see fit.  Feel free to rename more clearly also.\n\nThe model should also be updated to have a function that returns a formatted price string.  Formatting rules are discussed in section 3.\n\n2) Update the view(services/views.py) to get whatever data you will need to display.  This function currently works as follows.\n   1. NewAppearances/urls.py forwards the /sevices resource string to the services apps urls.py\n   2. services/urls.py specifies that if it has a blank resource sub-string then call views.index\n   3. services/views.py has its index method called index(request).  This method currently gets all Services from the database, wraps them in a context object and renders the template using that data\n\nTo get the view to work you'll need to populate the database.  To do this you can go to the Django admin site and create items. Once you have some test data look into Issue #3 to figure out how to export a fixture file and add it to the git repostiry.\n\nYou'll definitely need to populate your test database.\n\nIf you're feeling up to it you can also rewrite the view I created with Generic Views in Django.  If you do so you can also teach me how they work, because I feel super uncomfortable so far with them.\n\n3)Update services/templates/services.html to have an actual display for the body of the page and service data. Having a title text and then the name and the price of each service should be enough.  Make sure you also add styling  \n\nThe logic for price is as follows for right now and should be defined as a string returning function in the model\n     * If there is only a maximum_cost display the price as $<cost>\n     * If there is a minimum_cost and maximum_cost display the price as $<min>-$<max>\n     * If there is only a minimum_cost display the price at $<cost> & Up\nFeel free to update this logic if you think you can make the model smarter, this is just what I have for now.\n\nThe way services.html works is as follows.  First it extends base/base.html, which is our base template.  If you look at base.html, for right now it contains 3 django block tags (servicesStylesheet,servicesJavascript,body).  In  services.html, by extending it it means that you get all of the html from base.html, and you can override the block tags.  Everything in the same-named block element in services.html will replace whaver is in the corresponding block tag for base.html\n\nIf you override servicesStylesheet and servicesJavascript only use references to other files, dont do indoc CSS or JS.   I set up the file to reference some blank static files you can check out and add to.\n\noverriding body is how you should do the actual services layout.\n\n4) Create a test for your model.  I havent written any yet but you can look up how at https://docs.djangoproject.com/en/1.7/topics/testing/overview/\n\nYou can start by writing a test for every price format style that can be returned by the database.\n\n\nI know this is a lot for now, but I'm sure you can figure it out.  Feel free to reach out if you need any help or clarification\n\n\n----------------------------------------\n- Bitbucket: https://bitbucket.org/philsim7/newappearances/issue/2\n- Originally reported by: Phil Simmons\n- Originally created at: 2015-02-07T16:30:17.651\n"}}