Maintain/merge multiple schemas for CRUD and search?
43 views
Skip to first unread message
Manos Batsis
unread,
Feb 17, 2014, 3:17:02 PM2/17/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to backbon...@googlegroups.com
I was wondering how others maintain and perhaps merge schema definitions e.g. for overlapping models or different usecases like view, create, update, search etc?
Cheers,
Manos
Manos Batsis
unread,
Feb 22, 2014, 1:05:22 PM2/22/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to backbon...@googlegroups.com
Here's what I did in case someone finds it useful. I have changed the schema() of my base model [1] to handle an action parameter. The function calls a sub model's schemaComplete() to get the schema for all the actions and filters the appropriate parts. My submodels e.g. TextModel [2] provide a schemaComplete that adds a level in the schema notation to support multiple actions, including a default. Submodel's call their super model's schemaComplete, then use jquery's merge to provide a schema for the specified action.