What do you think about defining the model in the default TG2 template using
SQLAlchemy's declarative extension instead of using it the traditional way?
I think it would make the model look more natural and easier to get started.
I can implement it if you agree.
Cheers.
--
Gustavo Narea.
General Secretary. GNU/Linux Matters.
http://www.gnulinuxmatters.org/
-1
The SQLAlchemy documentation (which we will be referring people to on
a regular basis) uses the standard method of declaring tables/classes.
Personally I would prefer to allow people to use the documentation
available and not have to "translate" into the declarative mode.
Purely from a support standpoint I don't think changing this is the best idea.
--
Lee McFadden
blog: http://www.splee.co.uk
twitter: http://twitter.com/splee
> Purely from a support standpoint I don't think changing this is the best idea.
>
I'm +0 on this one. To be honest I do like declarative more, but we
shouldn't force it on people (specially new people).
On Sunday 03 August 2008 00:35:14 Lee McFadden wrote:
> The SQLAlchemy documentation (which we will be referring people to on
> a regular basis) uses the standard method of declaring tables/classes.
If you're talking about v0.4 that's right, but please check the documentation
for v0.5. The ORM tutorial itself uses the traditional way only in the
beginning, and the declarative method for the rest; I'm afraid it'll become
the standard/preferred method for SA 0.5.
> Personally I would prefer to allow people to use the documentation
> available and not have to "translate" into the declarative mode.
As Jorge has already pointed out, both methods are already present in the
documentation.
But I think the default template should use the declarative method and the
documentation should be mostly focused on this method.
> Purely from a support standpoint I don't think changing this is the best
> idea.
I think this only applies to SA 0.4, but things will change for v0.5.
Cheers,
Apologies, I hadn't really checked the SA 0.5 docs very thoroughly as
the first section looked almost identical and the changes in 0.5
didn't seem that huge. If the declarative method is also used in the
documentation then I am +0 on this.
If the SA docs use the declarative method, I say we should too. It's
a significant marketing win in terms of being more familiar looking to
SO/DjangoORM/ActiveRecord users, and we do want to attract those
people. And the declarative layer does look nice, and keeps things
together in a reasonable and easy to understand way, which is good for
a large set of applications.
At the same time, I'm most concerned that TG2 'scale up' to complex
problems and complex database stuff. Scaling down to solve easy
problems in a simple way is important too, but what I don't want is to
scale down at the expense of the ability to handle the complex stuff.
In this case I think declarative is a win for simple stuff, and it's
easy to switch to the manual when you need it.
So I'm +1 on this idea. If we patch the current TG to do it and
update the TG2 docs between now and the next alpha, I'm +2.
Sorry, I did not follow these developments - does this mean that Elixir
will lose its raison d'être?
-- Christoph
Possibly. I think they both do the same thing, differently. But the
declarative method is plain SA.
I can take care of both things if it's accepted.
I say go for it then. If there's some public outcry against it, we
can always have two templates one declarative, and one with tables,
objects, and mappers all split out.
--Mark Ramm
Perfect, I'll work on it tomorrow.
Cheers.
Any comments?
In addition to the declarative integration, I just modified the PKs to set
them to autoincrement - is this fine with you?
Hopefully I'll document the changes tomorrow.
Cheers.
But I tried to add another patch, to update the documentation, but it's
rejected by Akismet because of the amount of links. So the second patch is
attached. It corrects some minor mistakes, and adds three sections:
- Defining your own tables
- Using non-default names for identity-related tables and mapped classes
- Getting help
On Sunday 03 August 2008 20:10:51 Mark Ramm wrote:
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups
> "TurboGears Trunk" group. To post to this group, send email to
> turbogea...@googlegroups.com To unsubscribe from this group, send
> email to turbogears-tru...@googlegroups.com For more options,
> visit this group at http://groups.google.com/group/turbogears-trunk?hl=en
> -~----------~----~----~----~------~----~------~--~---
This is now in SVN.
Cheers.