On Oct 23, 10:47 pm, Jonathan LaCour <[EMAIL PROTECTED]> wrote: > Ben Sizer wrote: > > > - Generally responses have been along the lines of "you can use plain > > SA with Elixir", but can someone be more specific on how this is done? > > Can I refer to a plain SA class from Elixir and have it work, or vice > > versa? Is it more effort than just picking one of the two? > > There is a level of compatibility between plain SQLAlchemy and Elixir > right now, and I know that Gaetan is making this compatibility fully > bi-directional so that you can mix the two if needed. I don't know the > details on what is possible now, but if you ask on the Elixir list, I > bet you'll get a good answer on exactly what you can and cannot do. > Also, feel free to experiment and report bugs on the Trac. Being able > to mix the two is definitely a goal for Elixir, so you're never trapped > within Elixir's limitations.
Unfortunately the naive approach seems to yield errors like "AttributeError: type object 'User' has no attribute '_descriptor'", where User is a plain SA class and I've referred to it with a 'belongs_to' relation from an Elixir class. There are no hits for this error on either this or the SQLElixir group. I'm sure someone's documented how I get around this, somewhere. I'm guessing '_descriptor' is part of the private interface that Elixir Entities have, but beyond that, I dunno. > > - Specifically, am I going to have problems with the Identity stuff > > being in SA and the rest of my model being in Elixir? One or two of my > > Elixir objects will need to access one or two of the plain SA models, > > for certain. > > I just stopped using identity entirely since its design really makes it > work best with SQLObject, and I don't like a lot of other things about > it. There are plenty of alternatives ... this sort of hints at all that is bad about Turbogears, in my (apparently minority) opinion. Everybody seems to think that it's great that all the parts are interchangeable. Certainly, when you word it that way, it sounds good. But the other side of the coin is this - no new user wants to be told, as soon as they run into problems, that they can just swap out the part in question, usually for an even more obscure one. I can see Identity has flaws - I've posted about them myself on this list 6 months ago - but that's what Turbogears attempts to provide and document for authentication, so that's what I was going to use. I don't know the alternatives, and quite frankly it's hard enough trying to find out what Turbogears itself does, without trying to learn about a load of 3rd party libraries too, and potentially placing myself in a position where I find it difficult to get assistance. This philosophy flies in the face of "There's Only One Way To Do It" that suits so much of the rest of Python. I'm not arguing that one solution can always suit all, but I am arguing that explicitly catering to a combinatorial explosion of libraries does nobody any good except library developers. Possibly the best thing for me to do at this stage is just strip out Identity and all the associated objects, and write all the login stuff myself with Elixir. I expect it'll be poor compared to using Identity or Authkit or whatever the authentication flavour of the month module is, but at least I won't be chasing round the web and mailing lists trying to find out how to get it to comply. > but I also know that there are > people who use Identity with Elixir right now, and it works. You should > be able to do this, and I believe that the example provided with Elixir > still works. Which example? I typed "easy_install elixir", and got an .egg installed, and that's all I know. The 'examples' page on the Elixir Wiki is blank. > That seems like a huge waste of time. If you have something that > works for you today, and you like it, stick with it. Well, it doesn't work yet, that's the thing. I have a model.py that doesn't work due to the exception I noted earlier, and I can't go much further until I know what I'm supposed to do to make it work. I asked how to mix the 2 models and maybe when someone has an answer for me, I can proceed. Or maybe I'll just have to remove the plain SA stuff. I don't know. Sometimes it's hard to believe that there's anybody successfully using Turbogears who hasn't been a contributor of some sort. Certainly almost all the responses I get on here come from someone who's written a module or two, or a library that operates closely with it, so maybe that does suggest that it's only really usable by someone who's been digging through the source code. All I know at this stage is that it gets really demoralising to spend 20 minutes coding and then hours waiting for support, but that's been my Turbogears experience from day one. I apologise for the frustrated tone! It is just difficult when the language and tools become the barrier rather than the solution. Cheers, Ben Sizer --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

