ok, so as i get it, descriptors of PropertyLoaders cannot be used in
clauses.
any idea then how to map something like this then without going down
to tables:
(pseudocode)
Doc.ver == ver
and (
Doc.dbid == Doc2Place.nazn and
Doc2Place.rabmesto == ParamValueOwnership._rabotno_miasto
or
Doc.dbid == Doc2Position.nazn and (
Doc2Position.pozicia == ParamValueOwnership._pozicia
or
Doc2Position.pozicia == Position2Dept.pozicia and (
Position2Dept.otdel == ParamValueOwnership._otdel
or
Position2Dept.otdel == Dept2Dept.child and
Dept2Dept.roditel == ParamValueOwnership._otdel
)
)
)
and ParamValueOwnership.value == ParamValue.db_id
where:
Doc, Place, Position, Dept all have ParamValues (via m2m
ParamValueOwnership)
Doc has Place and Position (via m2m Doc2Place, Doc2Position)
Postion has Dept (via m2m Pos2Dept)
Dept has parent Dept (via m2m Dept2Dept)
the last one is recursive, but i'll handle it somehow, adjacent sets
or else.
another weirdness of above, the ParamValueOwnership m2m has different
links for diff. types of owners (mutualy exclusive), because
otherwise i get multiple inheritance.
can i handle multiple inheritance somehow? i.e. it looks like creating
same object via different polymorhic hierarchies..
several polymorphic mappers over the different hierarchies? will that
work?
On Tuesday 10 June 2008 16:39:57 you wrote:
> g'day.
> i stepped on strange behavour (0.4 latest):
> class AB is an assoc proxy, .myb pointing to B;
> the clause
> AB.myb == B.dbid
> fails with NotImplementedError:
> File "sqlalchemy/sql/expression.py", line 1191, in __eq__
> return self.operate(operators.eq, other)
> File "sqlalchemy/sql/expression.py", line 1315, in operate
> return o[0](self, op, other[0], *o[1:], **kwargs)
> File "sqlalchemy/sql/expression.py", line 1277, in __compare
> obj = self._check_literal(obj)
> File "sqlalchemy/sql/expression.py", line 1421, in _check_literal
> return other.expression_element()
> File "sqlalchemy/orm/attributes.py", line 53, in
> expression_element return self.comparator.expression_element()
> File "sqlalchemy/orm/interfaces.py", line 432, in
> expression_element return self.clause_element()
> File "sqlalchemy/sql/expression.py", line 1170, in clause_element
> raise NotImplementedError()
> NotImplementedError
>
> these work (not the .property):
> AB.myb.property == B.dbid
> AB.myb == 3
>
> AB.myb.property.direction is MANYTOONE
> seems i'm missing something??
> any idea or prepare a test case?
> svilen
On Tuesday 10 June 2008 21:15:06 Michael Bayer wrote:
> these are the valid comparisons:
>
> print AB.this == A()
> print AB.this_id == A.name
>
> On Jun 10, 2008, at 8:32 AM, [EMAIL PROTECTED] wrote:
> > funny... just a plain relation, i've removed all the assoc
> > stuff... what i am missing???
> >
> > here the case, attached.
> > no matter what, i doesnot work; older sa versions give different
> > error...
> >
> >>> these work (note the .property):
> >>> AB.myb.property == B.dbid
> >>> AB.myb == 3
> >>>
> >>> AB.myb.property.direction is MANYTOONE
> >>> seems i'm missing something??
> >>> any idea or prepare a test case?
> >>> svilen
> >
> > <aa.py>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---