Hi, working with DataNav. I have no problems with my app in Ubuntu, but
I'm having some trouble with accented characters (e.g. "áéíóú") in
windows. I think the problem is I'm doing something wrong but can't
figure out what.
These are CRUD forms automatically generated by dabo. In the GrdBase
object in "GrdCuenta.py" accents are shown correctly in the grid. In the
PagEditBase object in "PagEditCuenta.py" I've modified a field's input
control to this :
## Field Cuenta.CuentaId
label = dabo.ui.dLabel(self, NameBase="lblCuentaId",
Caption=biz.getColCaption("CuentaId"))
objectRef = dabo.ui.dDropdownList(self, NameBase="CuentaId",
DataSource="Cuenta", DataField="CuentaId",
ValueMode='Key',
ToolTipText=biz.getColToolTip("CuentaId"),
HelpText=biz.getColHelpText("CuentaId"))
objectRef.Choices, objectRef.Keys = self.Form.getMadres()
The getMadres() method in "FrmCuenta.py" goes :
def getMadres(self):
crs = self.getTempCursor()
crs.execute("""select Id, Nombre
from Cuenta
order by Nombre""")
ds = crs.getDataSet()
Choices = ['No Tiene'] + [reg['Nombre'] for reg in ds]
Keys = [None] + [reg['Id'] for reg in ds]
return (Choices, Keys)
But there must be something wrong here because the dDropDownList shows a
weird character instead of an "ó".
Using dShell I get
dDropDownList.Choices = ['No Tiene', 'Activo Corriente', 'Hijo
Activ\xc3\xb3 1', 'Hijo activ\xc3\xb3 2', 'Nieto Activo 1 - 3', 'Nieto
Activo 1-2', 'Nieto activo 1-1', 'Pasivo', 'Resultados']
Where you can see "\xc3\xb3" instead of an"ó". I am certain dabo is
working ok (the grid displays fine) but I'm blundering it with unicode
and stuff when using the TempCursor to get the Choices, and a pointer
here wold be much appreciated.
Thanks.
P.S.: Just in case it might be relevan, my "cuenta" bizobj reads
something like this :
self.DataStructure = (
("Id", "I", True, "Cuenta", "Id"),
("Codigo", "C", False, "Cuenta", "Codigo"),
("CuentaId", "I", False, "Cuenta", "CuentaId"),
("Nombre", "C", False, "Cuenta", "Nombre"),
("Imputable", "I", False, "Cuenta", "Imputable"),
("Orden", "I", False, "Cuenta", "Orden"),
("EsImputable", "C", False, None, "EsImputable"),
("CtaMadre", "C", False, "Cta", "Nombre"),
)
self.Encoding = "utf8"
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]