[BangPypers] How to iterate through columns in Model
senthil at uthcode.com
Thu Jul 16 21:28:48 CEST 2015
On Thu, Jul 16, 2015 at 10:51 AM, Sunil Gupta <sunil at planmytour.in> wrote:
> for each column in Obj
> if column.help_text != "" :
> print "The column ", column.verbose_name, " has value ",
> expected output
> The column Client Id has value Test_Client_Id
Look at the attributes / methods of Obj. Does it have something like
.values() ? Check the help of your ORM to find out.
then, it will be similar to what you have done.
for column in Obj.values():
if column.help_text is not None:
What ORM are you using?
More information about the BangPypers