It looks very similar to what I did but you use a decorator pattern
instead of Elixir Statements. Once I get this working in my app I will
gladly put something together for the wiki.

- Sean

On Apr 21, 4:04 am, "Gaetan de Menten" <[EMAIL PROTECTED]> wrote:
> On Mon, Apr 21, 2008 at 5:13 AM, Sean <[EMAIL PROTECTED]> wrote:
>
> >  I sat down today and came up with a strategy for using ActiveRecord-
> >  like validation in Elixr.
>
> >  I put the code on my blog here:  http://www.planningforaliens.com/?p=22
>
> >  Does it look useful? Is it a bad idea? I'm open to any feedback/
> >  criticism. It's working for me at the moment but I don't exactly have
> >  a production app put together!
>
> It looks useful, seems well done (at a quick glance) but... it's
> already built-in in Elixir (in a very similar way than what you did).
>
> from elixir.events import *
>
> class MyClass(Entity):
>         @before_insert
>         def my_validation_function(self):
>                 [do some stuff]
>
> See:http://elixir.ematia.de/trac/browser/elixir/trunk/tests/test_events.py
> for more examples.
>
> You probably missed it because of our lack of documentation. Sorry
> about that. If you have some time, I'd be grateful if you could expand
> our tutorial in the Wiki or start a new page introducing events, or
> even add a docstring to the events module so that other users don't
> need to reimplement the functionality themselves (even though the more
> people become familiar with the codebase the better, it's sad when
> it's for something already done).
>
> >  I took some direction from this guy and cleaned it up:
> >  http://beachcoder.wordpress.com/2007/05/02/adding-event-callbacks-to-...
>
> Yes, he was actually the starting point for our own implementation as well.
>
> --
> Gaƫtan de Mentenhttp://openhex.org
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to