linkyndy / remodel

Very simple yet powerful and extensible Object Document Mapper for RethinkDB, written in Python.
MIT License
193 stars 29 forks source link

update for latest python-rethinkdb #59

Closed ehrenb closed 5 years ago

ehrenb commented 5 years ago

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: https://github.com/rethinkdb/rethinkdb/issues/6722

linkyndy commented 5 years ago

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

linkyndy commented 5 years ago

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

ehrenb commented 5 years ago

Thanks for continuing to maintain !