Questions tagged [backbone-relational]

Get and set relations (one-to-one, one-to-many, many-to-one) for Backbone models.

Get and set relations (one-to-one, one-to-many, many-to-one) for Backbone models.

Resources:

256 questions
3
votes
1 answer

Backbone Relational validationError is not return when validation fails

I upgraded my backbone relational library to 0.10.0 I have problems with validating the model, the validationError attribute is undefined in callback method.This attribute has an object in previous version. If I changed code in the library file it…
3
votes
1 answer

Backbone.Collection has too many elements after save

I use Backbone with Marionette and backbone-relational. Let's say I have a zoo with a Backbone.Collection of animals. I have one animal stored in the database (with the id 1). Now I add a second animal to the Backbone.Collection and call…
3
votes
0 answers

Best(?) practice for loading & saving relational data in Polymer

What is the best, or just a good, practice for loading and saving relational data in Polymer elements' published properties? I've used https://github.com/PaulUithol/Backbone-relational to load and save relational data. It depends on Backbone. But…
3
votes
1 answer

backbone marionette related models

I'm trying to list some posts with their related users. Each post has a title some text and a userId like this: [{ "userId": 1, "id": 1, "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", "text": "quia…
3
votes
2 answers

'Backbone Relational' model relation adds an 'id' with a collection as a value, preventing PUT and DELETE

I successfully implemented loading and showing relations with 'Backbone Relational' from an API I created. I get how things work by trial and error. I do think the docs are lacking some clarity though since it took a lot of time to figure out how…
sidneydobber
  • 2,790
  • 1
  • 23
  • 32
3
votes
1 answer

Fetch backbone model parent relation without making additional request

I have models like this: window.Client = Backbone.RelationalModel.extend({ urlRoot: '/api/Client', relations: [ { type: Backbone.HasMany, key: 'appointments', relatedModel: 'Appointment', …
komov.r
  • 54
  • 3
3
votes
1 answer

Backbone Relational with Typescript

I've used Backbone Relational before, but not with Typescript, and I'm having trouble getting started: /// /// module Application.Models { …
user888734
  • 3,797
  • 5
  • 36
  • 67
3
votes
1 answer

Status of RequireJS and Backbone-Relational and/or Alternative to Backbone-Relational?

Preface- I recently learned about Backbone-Relational because I was interested in finding some sort of framework for working with nested backbone models. Problem- Console Warning: Relation = r : missing model, key or relatedModel (function…
ogginger
  • 433
  • 4
  • 11
3
votes
0 answers

RESTful route for many-to-many with double records in a Backbone application

I have a database schema with Reservations and Products. A reservation can have multiple products and a product can have multiple reservations. A reservation can also have a product multiple times. I have a many-to-many relation set-up for this,…
tomvo
  • 1,409
  • 1
  • 12
  • 21
3
votes
1 answer

Backbone Relational: Model with 2 collections of the same type

I'm trying to create a backbone relational model with 2 "hasMany" relations of the same type, but I'm getting the error: "Cannot create relation=child on "(myReverseRelationName)" for model=child: already taken by relation=child". Is this something…
frodo2975
  • 10,340
  • 3
  • 34
  • 41
3
votes
2 answers

Proper method for backbone-relational relationship definitions based on keys

I've been over the docs quite a few times, but this aspect still isn't clear to me. It's entirely possible that I'm thinking backbone-relational does something that it doesn't. I'm looking for the way to define relationships based on key to avoid…
nebulous
  • 738
  • 6
  • 17
3
votes
2 answers

Rendering a Collection with Multiple Sub Collections

I'm trying to convert an application to Backbone Marionette and am running into a problem rendering a collection of items that each contains multiple sub collections. The Background: I am working on an address book app, mostly for my own edification…
3
votes
1 answer

Backbone relational toJSON doesn't render all attributes

I've read this and this question already but it didn't help. I called fetchRelated this way: initialize: function(){ Artist.fetchRelated( 'albums', {success: this.render} ); }, render:…
3
votes
0 answers

Backbone relational with key in nested attribute

I am using Backbone-relational to have relational models. But i'm having a problem with related models of which the keys are in a nested attribute. My model looks like this: Event.Model = Backbone.RelationalModel.extend({ urlRoot: "/events", …
jaapz
  • 989
  • 8
  • 26
3
votes
1 answer

Backbone-relational not setting parent model, or reverse relation _id

In this app, an incident is something that happened, and a feeling is a nested object that describes how you felt about it. Here's my Incident model: window.Incident = Backbone.RelationalModel.extend({ urlRoot: "/incidents", idAttribute:…
mhurwi
  • 31
  • 4