diff -r aeabe6bed55b -r 569a3fe9cb88 app/soc/logic/models/base.py --- a/app/soc/logic/models/base.py Thu Feb 05 19:30:43 2009 +0000 +++ b/app/soc/logic/models/base.py Thu Feb 05 20:19:17 2009 +0000 @@ -132,23 +132,19 @@ pass def getKeyNameFromFields(self, fields): - """Returns the KeyName constructed from kwargs for this type of entity. + """Returns the KeyName constructed from fields dict for this type of entity. The KeyName is in the following format: - ::...: + //.../ """ key_field_names = self.getKeyFieldNames() - # check if all given KeyFieldNames are valid for this entity - if not all(key in key_field_names for key in fields.keys()): - raise Error("Some of the provided arguments are not key fields") - # check if all key_field_names for this entity are present in fields if not all(field in fields.keys() for field in key_field_names): raise Error("Not all the required key fields are present") - if not all(fields.values()): + if not all(fields.get(field) for field in key_field_names): raise Error("Not all KeyValues are non-false") # construct the KeyValues in the order given by getKeyFieldNames()