Well, it's the official Python way of doing it I guess. The automatic
accessor call is a relic and hopefully will vanish at some point. The
property is far more explicit, and you can use it in situations where
kiwi will not automatically call the accessor.

On 29/10/2007, Lucas Di Pentima <[EMAIL PROTECTED]> wrote:
> Oops, forgot to send it to the list, just for the record.
>
> ---------- Forwarded message ----------
> From: Lucas Di Pentima <[EMAIL PROTECTED]>
> Date: 29-oct-2007 18:45
> Subject: Re: Kiwi Label value mapping
> To: Ali Afshar <[EMAIL PROTECTED]>
>
>
> Thanks for your answer Ali! In fact, there's an 'official kiwi way' of
> doing this, I've just got it working: simply set a custom accesor to
> that attribute: get_gender(), and kiwi will check for it automatically
> :-)
>
> Thanks again!
>
> 2007/10/29, Ali Afshar <[EMAIL PROTECTED]>:
> > Hi,
> >
> > Probably the best (and easiest thing to do) is this:
> >
> > Add a property to your model class that returns exactly what you want
> > the label to show.
>
> [...]
> > Now any instance of Person will have the gender_string property which
> > you can read as any other attribute: myperson.gender_string. Then
> > setting the label's model attribute to 'gender_string' instead of
> > 'gender' will display what you want.
>
> --
> Lucas Di Pentima - http://lucas.di-pentima.com.ar
> GnuPG Public Key:
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6AA54FC9
> Key fingerprint = BD3B 08C4 661A 8C3B 1855  740C 8F98 3FCF 6AA5 4FC9
>
>
> --
> Lucas Di Pentima - http://lucas.di-pentima.com.ar
> GnuPG Public Key:
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6AA54FC9
> Key fingerprint = BD3B 08C4 661A 8C3B 1855  740C 8F98 3FCF 6AA5 4FC9
> _______________________________________________
> Kiwi mailing list
> [email protected]
> http://www.async.com.br/mailman/listinfo/kiwi
>
_______________________________________________
Kiwi mailing list
[email protected]
http://www.async.com.br/mailman/listinfo/kiwi

Reply via email to