Can someone explain this construct to me?

 

        errors = [(field_name, '%s is required' % field_name)

                   for field_name in required_fields

                   if self._is_empty(ticket[field_name])]

 

What does 'errors' contain? I can see that it's a list of some
sort...but the parenthetical grouping in the first line looks like it is
some kind of initializer for field_name...so what does it return? The
contents of field_name? and how does the for loop work...what's the
difference between the if returning false or true?

 

Dan Winslow
Director of Information Technology, AIM INSTITUTE
1905 Harney Street, Suite 700
Omaha, NE 68102
402-345-5025 x156
dwins...@aiminstitute.org
www.aiminstitute.org

 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to