Leandro Severino schrieb:
> Well, When I load the page, I call the method tipoImovel(self), but
> always I have that to load the object tipoImovel(TipoImovel.get(1)),
> because if I don't make this , it give me an error because the input
> fields need of a value.
>
> How to resolve this situation ?, How to load a empty tipoImovel
> object or don't receive this error ? or what is the best solution or
> design to my page ?
Option 1)
- In the 'tipoImovel' method return dict(tipoImovel=None,tipos=tipos)
- Change the input fields to something like:
<div py:if="tipImovel" py:strip="">
<input value="${tipoImovel.sigla}" ...>
</div>
<div py:if="tipImovel is None" py:strip="">
<input value="" ...>
</div>
Option 2)
Use widgets forms:
- http://docs.turbogears.org/1.0/Widgets
- http://docs.turbogears.org/1.0/SimpleWidgetForm
HTH, Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---