Здравствуйте. Почему python воспринимает функцию класса как его атрибут?
Использую Orator ORM
domain = Domain()
domains = domain.where('userid',2).get()
Traceback (most recent call last):
File "test.py", line 36, in <module>
domains = domain.where('userid',2).get()
File "/home/user/orator/app/local/lib/python2.7/site-packages/orator/orm/m
odel.py", line 2838, in __getattr__
return self.get_attribute(item)
File "/home/user/orator/app/local/lib/python2.7/site-packages/orator/orm/m
odel.py", line 2301, in get_attribute
relation = original or super(Model, self).__getattribute__(key)
AttributeError: 'Domain' object has no attribute 'where'
Сам класс Domain:
from orator import Model, DatabaseManager
import json
from orator.exceptions.orm import ModelNotFound
config = {
'mysql': {
'driver': 'mysql',
'host': 'localhost',
'database': 'quad7_prod',
'user': 'quad7_prod',
'password': 'password',
'prefix': ''
}
}
db = DatabaseManager(config)
Model.set_connection_resolver(db)
class Domain(Model):
__table__ = 'domain'
__timestamps__ = False
__primary_key__ = 'id'
__fillable__ = [
'userid',
'command',
'time',
'status',
]