Feature Request: Manager methods to return querysets rather than lists #1206
Labels
devel-implemented
Already finished, usually in a branch not yet merged.
feature-request
A suggestion for new functionality.
Projects
Brief summary of issue / Description of requested feature:
Today, many of Evennia's custom managers (such as
Objectdb.objects.get_objs_with_attr) will return a list rather than a Django queryset. Most of the time this doesn't matter, but it does matter when it comes to building custom queries - a list cannot be combined with a further query.This feature request proposes to make all manager methods return querysets the same way Django's normal manager methods do.
Reasons for adding feature:
The original reason for Evennia's manager methods returning lists/individual objects was that Evennia's Typeclass system was separate from Django models - hence the managers must all make sure to return typeclasses rather than dbobjects. To this end, the managers all processed the returned database objects and converted them safely to lists of Typeclasses before returning. These days however, typeclasses are proxy models and the normal database operations return them directly. No conversion is needed and instead it's them being returned as lists that is the problem.
Pros:
Cons:
list()on it first).Extra information, such as Evennia revision/repo/branch, operating system and ideas for how to solve / implement:
This is a big enough API change that it will go into the devel branch leading up to Evennia 0.7.
The text was updated successfully, but these errors were encountered: