Hello,
I've figured out that my problem was to define the class properties in
__init__ and after looking into the alchemy FAQ I solved the problem.
I have one remaining problem though: I would like to set the
properties of my Entity classes (that inherit from Entity or a custom
base class) programatically using "has_field".
Can someone tell me whether it is possible to use has_field from a
function or even better from something similar to __init__ in the
custom base class? Please, see the details below to make my question
a bit concrete.
thanks in advance for any advice.
-b
To be a bit more concrete:
# this works:
class Something(elixir.Entity):
spec = [MyIntField(name='...), MyTxtField(name='..)]
for field in [spec]:
has_field(field.name, field.elixirField)
webForm, javaScriptIncludes = setupAll(spec)
# but I would prefer something like:
class Something(elixir.Entity):
spec = [MyIntField(name='...), MyTxtField(name='..)]
setupAll(spec)
# where setupAll sets all the class properties and calles all the "has_field"
# or even better, a custom base class that calls the setupAll automatically..
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---