On Mon, Jul 18, 2011 at 6:30 PM, Andre Terra <[email protected]> wrote:
> There is an error because you are concatenating the function _() and the > string '%s: %s \n' > > You also don't need the space before \n > > and don't add unnecessary spaces: (the_waybill, str(errorObj.code)) is the > right way to write the last part of the code[1]. > Damn, I always add spaces.. didn't realise there was a PEP against it :X Ty for this. > > > [1] http://www.python.org/dev/peps/pep-0008/ > > > > Regards, > AT > > > On Mon, Jul 18, 2011 at 2:21 PM, NISA BALAKRISHNAN < > [email protected]> wrote: > >> >> self.ErrorMessages = _('Problem with data of Waybill') ' %s: %s \n' % >> ( the_waybill, str( errorObj.code ) ) >> >> there is an error in this statement. i do not know if this is a valid >> python assignment statement >> becoz what i want to assign to self.errormessages is Problem with data >> of waybill (-value in- -variable waybill--) : (errorobjcode) . >> Problem with data of waybill is a translatable string. >> On Jul 18, 9:14 pm, "Cal Leeming [Simplicity Media Ltd]" >> <[email protected]> wrote: >> > Something like this? >> > >> > _str = _('Problem with data of Waybill') >> > _str2 = "%s: %s \n" % ( the_waybill, str( errorObj.code ) ) >> > self.ErrorMessages = "%s %s" % ( _str, _str2) >> > >> > (i split into two parts to make it easier on the eyes) >> > >> > Cal >> > >> > On Mon, Jul 18, 2011 at 5:59 PM, NISA BALAKRISHNAN < >> > >> > >> > >> > >> > >> > >> > >> > [email protected]> wrote: >> > > what is the correct syntax for this: >> > > self.ErrorMessages = _('Problem with data of Waybill') '%s: %s \n' % >> > > ( the_waybill, str( errorObj.code ) ) >> > >> > > -- >> > > You received this message because you are subscribed to the Google >> Groups >> > > "Django users" group. >> > > To post to this group, send email to [email protected]. >> > > To unsubscribe from this group, send email to >> > > [email protected]. >> > > For more options, visit this group at >> > >http://groups.google.com/group/django-users?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

