On May 6, 2007, at 5:51 AM, VGSoftware wrote:
> I hava some experience with gettext on php and C languages, i
> suppose it
> is similar on python, i'm on a tight schedule now, and this is not my
> priority, however i will need it in the project i'm developing, so
> yes,
> i will scratch my itch, as soon as i have made some progress i'l
> get in
> touch.
Sounds good. I know how to use pygettext() to create the translation
files; my main concern is how to arrange the locale directories,
given dabo's directory structure. I've googled this several times,
and can't seem to find an answer.
> I have another question, i would solve it myself if i was not in
> such a
> hurry....
> In a datanav.Grid, how can i show the value pointed by a foreign key
> instead of the id??
You need to modify the query to pull in that related value.
> For example:
>
> Table 1
> ID|VALUE
> 10|xpto
> 11|abc
>
> Table2
> ID|T1_FK|VALUE
> 25|10 |another value
>
> if i create a datanav.Grid of Table2 it will show the "10" value in
> the
> grid, i'd like it to show "xpto"
Look at the code for your Table2 bizobj. In the setBaseSQL() method
you'll need to add the following:
self.addJoin("Table1", "Table2.T1_FK = Table1.ID")
self.addField("Table1.VALUE as T1_val")
This will now create the query that will include the related
Table1.VALUE column. Now you need to modify your grid class (should
be in ui/GrdTable2.py), and find the 'self.addColumn(...)' line that
has 'DataField="T1_FK"' in it, and change that to:
DataField="T1_val". This tells the grid to display the new column you
just added to the query, instead of the original FK column. You can
then modify the other pages to include this column instead of the FK
field if you wish.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]