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

Can't push an array when initializing a list of references to ListField;can only append #31

Open
GorgeouslyHumble opened this issue Nov 18, 2013 · 0 comments

Comments

@GorgeouslyHumble
Copy link

So if I do something like this:

dog = Dog(name="Daryl",
breed="Construction worker",
description="He told his wife that he liked her sister's cooking better.",
current_doghouse=(couch),
previous_doghouses=[silent_treatment, snide_comments])

I get this:

Traceback (most recent call last):
File "redisco_reference_test.py", line 37, in
dog.save()
File "/usr/local/lib/python2.7/dist-packages/redisco/models/base.py", line 324, in save
self._write(_new)
File "/usr/local/lib/python2.7/dist-packages/redisco/models/base.py", line 581, in _write
pipeline.execute()
File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 1987, in execute
return execute(conn, stack, raise_on_error)
File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 1911, in _execute_transaction
self.raise_first_error(response)
File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 1946, in raise_first_error
raise r
redis.exceptions.ResponseError: ERR wrong number of arguments for 'rpush' command

However, appending an element to that list (like exampled within Redisco's tests),

daryl.previous_doghouses.append([snide_comments, cold_shoulder])
print daryl.previous_doghouses

[<Doghouse:2 {'location': u'the cold side of the bed', 'id': '2'}>, [<Doghouse:7 {'location': 'kitchen table', 'id': '7'}>, <Doghouse:8 {'location': 'everywhere', 'id': '8'}>]]

Works perfectly!

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