Skip to content
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

Support for writable ManyToManyField's #28

Open
cript0nauta opened this issue Apr 8, 2015 · 0 comments
Open

Support for writable ManyToManyField's #28

cript0nauta opened this issue Apr 8, 2015 · 0 comments

Comments

@cript0nauta
Copy link

Hii, I'm using ROA as a client of a Django Rest Framework API. I defined in both sides a basic many to many field. In DRF i can read and write this via json as a list ok primary keys.
In ROA i can read this field correctly but for writing I can't: The clear() method doesn't work and add() throws thid error:
Cannot add "<Model: XXXX>": instance is on database "None", value is on database "default"
It seems that this happens because it reads the model on the local database and not via the API.
Some useful information:

>>> model = Model.objects.first()
>>> model.m2m_field
<django.db.models.fields.related.ManyRelatedManager at 0x7f2323f6a810>
>>> model.m2m_field.is_roa_manager
True

How can I solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant