Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (36 sloc) 1.17 KB

  1. Models
Even though the application only deals with one CouchDB table/database, for convience, interacting with the datasource is split into the following two models:

    1. Paste
Data model for access the pastebin documents. In this instance it works as an inbetween of the controller and the CouchDB adapter. The goal being that the controller can ask for data in a very generic way. Now in 0.3 version, no special considerations are needed when interacting with it.
      1. To find:
      2. To save:
    1. PasteView
This model is used to store Couch design views to the `Paste` database It also defines it. Do not call a 'find' on this model. To view the view, use the 'design' condition in a 'find' call on the `Paste` model, ie :
      1. Index page data is found with :
When the find call in the example above returns a NULL, that means the view does not exist in the `Paste` database.
      1. To create and save the latest view: