From 0c196d253cba420b7560cd32caf2f3d4cc18a3a2 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 21 Feb 2012 12:07:28 +0100 Subject: [PATCH] cosmetic / nicer dumps --- sfa/storage/model.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sfa/storage/model.py b/sfa/storage/model.py index caf75b91..0b7ddb74 100644 --- a/sfa/storage/model.py +++ b/sfa/storage/model.py @@ -110,22 +110,21 @@ class AlchemyObj: last_updated = utcparse(datetime_to_string(self.last_updated)) print " last updated:", last_updated print " gid:" - print "\t\t", self.get_gid_object().dump_string(8, dump_parents) + print self.get_gid_object().dump_string(8, dump_parents) # print remaining fields for attrib_name in dir(self): - # skip core fields - if attrib_name in core_fields: - continue - # skik callables attrib = getattr(self, attrib_name) - if callable(attrib): - continue + # skip internals + if attrib_name.startswith('_'): continue + # skip core fields + if attrib_name in core_fields: continue + # skip callables + if callable (attrib): continue print " %s: %s" % (attrib_name, attrib) def dump_simple(self): - return "Record(record_id=%s, hrn=%s, type=%s, authority=%s, pointer=%s)" % \ - (self.record_id, self.hrn, self.type, self.authority, self.pointer) + return "%s"%self # # only intended for debugging # def inspect (self, logger, message=""): -- 2.43.0