On Aug 29, 10:36 am, Jonathan LaCour <[EMAIL PROTECTED]>
wrote:
> Okay, I have had lots of discussions on this over the past few months,
> and its becoming more and more clear that the majority of people prefer
> the more traditional approach when it comes to defining fields. So,
> with that said, I think we need to listen to our users here, and start
> supporting the traditional syntax, but only for defining fields. I
> think the relation style needs to remain as a DSL-like approach.
>
> That being said, I think its time that we went ahead and deprecated
> `with_fields` in favor of the "OO" approach, since the syntaxes will end
> up being quite similar, with the added bonus of preserving field order:
>
> class Person(Entity):
> id = Field(Integer, primary_key=True)
> name = Field(String)
>
> has_many('pets', of_kind='Pet', inverse='owner')
>
> In the long-term, we might want to deprecate `has_field` as well, so
> that we will have only one way to do things. I am hesitant to do this
> right now, but I haven't been happy having two ways to do the same thing
> for some time now, and I think we need to resolve this at some point.
>
> So, the long and short of it is that I will finally break down, so I
> don't have to hear about it anymore ;) So, whoever wants this, please go
> ahead and work on a patch, and we'll try to get it into the 0.4 release
> so that people can use it sooner rather than later. I want this to be
> the last major API breakage before we release 0.4, and hopefully for a
> long time to come. The patch should contain tests and documentation
> updates before we'll accept it.
Sounds good! I've got a test set up with that syntax, and am trying to
add in the support by adding a function to handle the dict_ parameter
on the init function of EntityMeta - would that be the right place to
do this? I'm mostly using the source of Statement.process and one of
the earlier TurboEntity releases as references, so if there's a better
place for it to be, let me know. It's not working as of yet, but the
long weekend coming up should be a good time to get it finished &
submitted. Should the patches be submitted to Trac now, or directly to
the devs, or ...?
Thanks,
Adam Gomaa
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---