elixir support in TG2 added

0 views
Skip to first unread message

Diez B. Roggisch

unread,
Sep 3, 2008, 3:52:42 PM9/3/08
to turbogea...@googlegroups.com
Hi,

in r5349 I added elixir-support in TG2. It unfortunately requires elixir
trunk, because that contains a patch which allows ManyToMany-relations
to specify precisely. I thought that it would be good to try & make the
schema for identity the same.

If we don't care, we could just go for latest elixir. Any opinions on that?

Another question: I'd of course like to write unit-tests for the
identity models. The current tg2 and tgdev testsuites don't contain
these. Which isn't to surprising, as only a quickstarted project
actually contains them.

So... how could I go about that?

Diez

Mark Ramm

unread,
Sep 3, 2008, 5:25:14 PM9/3/08
to turbogea...@googlegroups.com
devtools has a test that does a quickstart, perhaps we could extend that.

I also want to create a "full stack" test suite for tg2, which uses a
TestConfig subclass of AppConfig, and allows us to test more complex
interactions between our middleware components.

I just have not had time to write that yet.

--mark

--
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog

Doug Latornell

unread,
Sep 3, 2008, 7:59:47 PM9/3/08
to TurboGears Trunk
Something's not quite right, I think, because

$ paster quickstart Foo
$ paster quickstart -e Foo
$ paster quickstart --elixir

all yield a model/__init__.py file with import elixir, etc. in it. I
would expect the last 2 to do that, but the first command should
produce an app without elixir.

I had a quick look at r5349 quickstart.py and can't see what the
problem is.

Doug

Diez B. Roggisch

unread,
Sep 4, 2008, 5:11:58 AM9/4/08
to turbogea...@googlegroups.com
On Thursday 04 September 2008 01:59:47 Doug Latornell wrote:
> Something's not quite right, I think, because
>
> $ paster quickstart Foo
> $ paster quickstart -e Foo
> $ paster quickstart --elixir
>
> all yield a model/__init__.py file with import elixir, etc. in it. I
> would expect the last 2 to do that, but the first command should
> produce an app without elixir.
>
> I had a quick look at r5349 quickstart.py and can't see what the
> problem is.
>

Me neither. Debugging into right before the paster is started, I get these
parameters (w/o elixir of course):

['--template=turbogears2',
'Foo',
'sqlalchemy=True',
'elixir=False',
'sqlobject=False',
'identity=sqlalchemy',
'package=foo',
'tgversion=1.9.7a4dev-r5287']


So it appears as if the pure fact that I included elixir in the templates made
these appear.

Now I wonder: given that there seems to be no distinction between boolean and
strings, might it be that we have a case of

elixir = "False"

which is of course True in an expression like this?

if elixir:

Is there a way/need to declare an argument as being boolean?

Diez

Diez B. Roggisch

unread,
Sep 4, 2008, 5:20:31 AM9/4/08
to turbogea...@googlegroups.com, Doug Latornell
On Thursday 04 September 2008 01:59:47 Doug Latornell wrote:
> Something's not quite right, I think, because
>
> $ paster quickstart Foo
> $ paster quickstart -e Foo
> $ paster quickstart --elixir
>
> all yield a model/__init__.py file with import elixir, etc. in it. I
> would expect the last 2 to do that, but the first command should
> produce an app without elixir.
>
> I had a quick look at r5349 quickstart.py and can't see what the
> problem is.

Ok, I created the attached patch. I can't commit that from work (no SSH, thus
no SVN), but maybe somebody else can apply it, or you can test it at least.

I don't know much about paster - but to me it looks as if we will run into the
same problem the very moment we e.g. start supporting sqlobject -

{{if sqlalchemy}}

will also be True, even if it is set to "False". Unless there is something I
don't know about, but I didn't find anything using grep in the sources that
appeared to make sqlalchemy something special elixir as argument isn't.

Diez

elixir.patch

Gustavo Narea

unread,
Sep 4, 2008, 7:32:53 AM9/4/08
to turbogea...@googlegroups.com
Hello,

That's awesome.

You may also want to make tg.testutil.DBTest work with Elixir.

Cheers!

--
Gustavo Narea.
General Secretary. GNU/Linux Matters.
http://www.gnulinuxmatters.org/

Reply all
Reply to author
Forward
0 new messages