backbone.js - Backbone relational - how is it possible to find related model by two foreign keys? -
in model i've defined relationship, it's property foreign key substituded related model.
i had idea give away database 2 same values, example relatedid
, related
- if define models relationships field related
, relatedid
value left untouched - , able use it.
is possible somehow use collection.where() method in backbone relational on model attributes, represent related models (they have object data type)? if define related id - following - not work:
collection.where({ related : 14 // property contains related model, not id after backbone initializes, i've tried use relatedid key instead - not work })
i need such method much, because have find models lot of attributes, , hard scratch :/
could please advice way?
i using database "views" flatten relationships way easier querying. works well.
Comments
Post a Comment