Re: [BangPypers] How to iterate through columns in Model

2015-07-16 Thread kracekumar ramaraju
Hi Sunil Looks like you're using Django Here is an example ``` In [38]: user = User.objects.all()[0] In [39]: fields = user._meta.local_fields In [40]: for field in fields: if field.help_text: print(field.name, unicode(field.help_text), getattr(user, field.name )) : ('is_sup

Re: [BangPypers] How to iterate through columns in Model

2015-07-16 Thread Senthil Kumaran
On Thu, Jul 16, 2015 at 10:51 AM, Sunil Gupta wrote: > for each column in Obj > if column.help_text != "" : > print "The column ", column.verbose_name, " has value ", > column.value > > expected output > > The column Client Id has value Test_Client_Id > Look at the attributes

[BangPypers] How to iterate through columns in Model

2015-07-16 Thread Sunil Gupta
Hi All how can I iterate through the columns for an object in model example for an given object of a model I want to print the verbose name and its value when the help_text in the model is not NULL. class Client(models.Model): cli_clientid = models.CharField(primary_key=True, verbose_name =