3333 is_attachment = False ,
3434 is_filepath = False ,
3535 is_external = False ,
36+ is_hidden = False ,
3637 adapter = None ,
3738 store = None ,
3839 unsupported = False ,
@@ -124,32 +125,37 @@ def attributes(self):
124125
125126 @property
126127 def names (self ):
127- return [k for k in self .attributes ]
128+ return [k for k in self .attributes if not self . attributes [ k ]. is_hidden ]
128129
129130 @property
130131 def primary_key (self ):
131- return [k for k , v in self .attributes .items () if v .in_key ]
132+ return [k for k , v in self .attributes .items () if v .in_key and not v . is_hidden ]
132133
133134 @property
134135 def secondary_attributes (self ):
135- return [k for k , v in self .attributes .items () if not v .in_key ]
136+ return [
137+ k for k , v in self .attributes .items () if not v .in_key and not v .is_hidden
138+ ]
136139
137140 @property
138141 def blobs (self ):
139- return [k for k , v in self .attributes .items () if v .is_blob ]
142+ return [k for k , v in self .attributes .items () if v .is_blob and not v . is_hidden ]
140143
141144 @property
142145 def non_blobs (self ):
143146 return [
144147 k
145148 for k , v in self .attributes .items ()
146149 if not (v .is_blob or v .is_attachment or v .is_filepath or v .json )
150+ and not v .is_hidden
147151 ]
148152
149153 @property
150154 def new_attributes (self ):
151155 return [
152- k for k , v in self .attributes .items () if v .attribute_expression is not None
156+ k
157+ for k , v in self .attributes .items ()
158+ if v .attribute_expression is not None and not v .is_hidden
153159 ]
154160
155161 def __getitem__ (self , name ):
@@ -165,6 +171,8 @@ def __repr__(self):
165171 if self ._table_status is not None :
166172 ret += "# " + self .table_status ["comment" ] + "\n "
167173 for v in self .attributes .values ():
174+ if v .is_hidden :
175+ continue
168176 if in_key and not v .in_key :
169177 ret += "---\n "
170178 in_key = False
@@ -298,6 +306,7 @@ def _init_from_database(self):
298306 store = None ,
299307 is_external = False ,
300308 attribute_expression = None ,
309+ is_hidden = attr ["name" ].startswith ("_" ),
301310 )
302311
303312 if any (TYPE_PATTERN [t ].match (attr ["type" ]) for t in ("INTEGER" , "FLOAT" )):
0 commit comments