Exemple #1
0
	def attr_iter(self, action):
		for aid in self._attr_ids:
			attr = self._attr_map[aid]

			from germ.error.error import error
			error(error.debug, 'checking attribute', aid)

			if attr.dyn_perm(action):
				yield attr
			else:
				from germ.attr.dummy import dummy
				yield dummy()
Exemple #2
0
	def get_attr(self, attr, action):
		if self.__has_attr(attr):
			a = self._attr_map[attr]

			if attr in self._pk_set or a.dyn_perm(action):
				return a

		#from germ.error.error import error
		#raise error(error.fail, errmsg.nonexistent_attr,
		#	'table: %s, attribute: %s' % (self._name, attr))

		from germ.attr.dummy import dummy
		return dummy()