-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
collection.create doesn't save a model's children #25
Comments
Hi folks, any idea how to perform this? |
@e2jk, can you post your model definition and example form data? |
The model definition: http://pastebin.com/iMkFb3TG When posting information on the page to create a new record, the following data is posted from the form:
As you can see, all the data from the children is empty.
I've added a debug console log just after |
This is the text version of the screenshot (with another object I've just created). It's the output of
|
Hi there, any thoughts about this issue? |
I couldn't understand from your pastepin what you are trying to do. Try to create a minimal example that doesn't work. I sense that you may be mixing between |
I have a model that has children (i.e. links to other instances of 2 other model types).
The models are kept in a collection.
When calling
collection.create
with thedata
from the POST, the model is created with empty children. If I edit the model (at which point a simplemodel.save
is performed), using the same form, the model properly gets its children populated.I've gotten around this for now by calling
collection.create
which creates the model without the children and adds it to my collection, and then within that success function I'm callingmodel.save
with the same data from the post. This is how it looks like:I would expect
collection.create
to create the model including the children, as those are present just fine in thedata
retrieved from the form.The text was updated successfully, but these errors were encountered: