linkyndy/remodel

update for latest python-rethinkdb

ehrenb opened this issue · 3 comments

Hi, remodel appears to be broken after a recent python-rethinkdb version change. Using Python3, remodel, and python-rethinkdb2.4.2, I get the following exception when creating a very simple Model:

>>> from remodel.models import Model, before_save
>>> 
>>> class A(Model):
...     pass
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/branden/venvs/remodel/lib/python3.5/site-packages/remodel/models.py", line 49, in __new__
    setattr(new_class, 'objects', object_handler_cls(new_class))
  File "/home/branden/venvs/remodel/lib/python3.5/site-packages/remodel/object_handler.py", line 7, in __init__
    self.query = query or r.table(model_cls._table)
AttributeError: module 'rethinkdb' has no attribute 'table'

This issue on the rethinkdb repo might contain the solution: rethinkdb/rethinkdb#6722

Hello Branden, thanks for pointing this out! I will have a look.

@ehrenb, this is fixed and will soon be released in a new (major) version of remodel. Thanks for opening this up!

Thanks for continuing to maintain !