MCPcopy
hub / github.com/ponyorm/pony / exclude

Method exclude

pony/orm/core.py:1518–1528  ·  view source on GitHub ↗
(rule, *args)

Source from the content-addressed store, hash-verified

1516 for perm in rule.permissions:
1517 entity._access_rules_[perm].add(rule)
1518 def exclude(rule, *args):
1519 for arg in args:
1520 if isinstance(arg, EntityMeta):
1521 entity = arg
1522 rule.entities_to_exclude.add(entity)
1523 rule.entities_to_exclude.update(entity._subclasses_)
1524 elif isinstance(arg, Attribute):
1525 attr = arg
1526 if attr.pk_offset is not None: throw(TypeError, 'Primary key attribute %s cannot be excluded' % attr)
1527 rule.attrs_to_exclude.add(attr)
1528 else: throw(TypeError, 'Entity or attribute expected. Got: %r' % arg)
1529
1530@cut_traceback
1531def has_perm(user, perm, x):

Callers

nothing calls this directly

Calls 3

throwFunction · 0.90
addMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected