mirror of
https://github.com/yweber/lodel2.git
synced 2026-06-09 12:30:48 +02:00
Changed the object_collection_name method in the utils of mongodb datasource plugin
This commit is contained in:
parent
996bc334a1
commit
98ffe11d5f
2 changed files with 9 additions and 1 deletions
|
|
@ -97,6 +97,11 @@ class MongoDbDatasource(object):
|
|||
|
||||
collection_name = object_collection_name(target)
|
||||
collection = self.database[collection_name]
|
||||
|
||||
if not target.abstract:
|
||||
# Add the class name to the filters
|
||||
filters.append(('classname', '=', target.__name__))
|
||||
|
||||
query_filters = self.__process_filters(
|
||||
target, filters, rel_filters)
|
||||
query_result_ordering = None
|
||||
|
|
|
|||
|
|
@ -67,7 +67,10 @@ def connect(host, port, db_name, username, password):
|
|||
# @param class_object EmClass
|
||||
# @return str
|
||||
def object_collection_name(class_object):
|
||||
if class_object.abstract:
|
||||
return class_object.__name__
|
||||
else:
|
||||
return object_collection_name(class_object.__base__)
|
||||
|
||||
|
||||
## @brief Determine a collection field name given a lodel2 fieldname
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue