Change-Id: If278ea170e0a17b1e8ace2d470fb2fbdb7a6e9c1
References: #9370
References: #9365
@fullname.expression
def fullname(cls):
return case(
- [
- (cls.firstname != None, cls.firstname + " " + cls.lastname),
- ],
+ (cls.firstname != None, cls.firstname + " " + cls.lastname),
else_=cls.lastname,
)
connection.execute(
personnel.update(personnel.c.rgt >= right_most_sibling).values(
lft=case(
- [
- (
- personnel.c.lft > right_most_sibling,
- personnel.c.lft + 2,
- )
- ],
+ (
+ personnel.c.lft > right_most_sibling,
+ personnel.c.lft + 2,
+ ),
else_=personnel.c.lft,
),
rgt=case(
- [
- (
- personnel.c.rgt >= right_most_sibling,
- personnel.c.rgt + 2,
- )
- ],
+ (
+ personnel.c.rgt >= right_most_sibling,
+ personnel.c.rgt + 2,
+ ),
else_=personnel.c.rgt,
),
)
for attribute, discriminator in pairs
if attribute is not None
]
- return case(whens, value=self.cls.type, else_=null())
+ return case(*whens, value=self.cls.type, else_=null())
def __eq__(self, other):
return self._case() == cast(other, String)