You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I specify relations between models and query them? Take a simple tagging application as an example: you have one model representing your main entity (source code snippet, photo, comment etc) and one model representing a tag.
How can I query all main entities that have a certain tag assigned? Or all entities without tag?
The text was updated successfully, but these errors were encountered:
Querying logic is part of the interface with your application -- there are a number of ways you can handle it:
Change the url() that the Collection returns to include your current search query. The next time you fetch() it's models, they'll be replaced by models that match the current search. This is useful for collections that contain search results.
Just run your regular jQuery Ajax call, and refresh the collection with the results. This can happen in a method that you add to your collection, like fetchForTag...
If you want to include tags nested in the same response as the photos, you can have your model pull them out, and turn them into Tag objects of their own...
How can I specify relations between models and query them? Take a simple tagging application as an example: you have one model representing your main entity (source code snippet, photo, comment etc) and one model representing a tag.
How can I query all main entities that have a certain tag assigned? Or all entities without tag?
The text was updated successfully, but these errors were encountered: