ReferenceSet should allow arbitrary qualifiers for WHERE clause
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
New
|
Undecided
|
Unassigned |
Bug Description
When building one-to-many or many-to-many relations, it is not uncommon to have relation qualifiers.
Consider the Company + Employee example from the tutorial. The Employees table might have an extra 'type' field indicating whether the employee is a manager, production line worker or contractor. So instead of/in addition to having the Company.employees property list all employees, one might want Company.managers, Company.workers, etc. properties. Thanks to BoundReferenceSet's find() method, it is already possible to build such properties in a read-only way:
>>> class Company(object):
... __storm_table__ = "company"
... id = Int(primary=True)
... employees = ReferenceSet(id, Employee.
...
... @property
... def managers(self):
... return self.employees.
This won't allow you to say mycompany.
managers = ReferenceSet(id, Employee.
I will be giving the implementation a shot https:/ /code.launchpad .net/~philikon/ storm/qualified -reference