Пример #1
0
    def get_rec(self):
        # in order to fill the table with values we need an entry, identified
        # by its primary key
        if not self.pks_locked():
            from germ.error.missing_pk_lock import missing_pk_lock

            raise missing_pk_lock()

        return self.get_rec_explicit(self._name, self.get_attr_sql_pk())
Пример #2
0
	def __analyze(self):
		# add primary key relation
		# TODO: fix this comment
		# NB: This has to be done _after_ the other reference groups are built
		# for the reason described in the 'pk_submit_relation' class.
		# Fortunately this is done in the entity constructor so we don't stand
		# a chance of violating this condition here.
		self._tbl.add_rel(self.__get_pk_rel())

		found_missing_lock = False

		for ref_grp in self._tbl.get_ref_group_vec():
			missing_lock, missing_pk_lock = \
					ref_grp.generate_keylist(self.__act_str)

			if missing_lock:
				# If we need the primary key, we have to prompt for PKs only.
				if self.__fill_table and missing_pk_lock:
						from germ.error.missing_pk_lock import missing_pk_lock
						raise missing_pk_lock()

				found_missing_lock = True

		return found_missing_lock