Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
ActiveRecords-like validation
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
bruno.desthuilliers@gmail .com  
View profile  
(1 user)  More options Apr 25 2007, 3:42 pm
From: "bruno.desthuilli...@gmail.com" <bruno.desthuilli...@gmail.com>
Date: Wed, 25 Apr 2007 12:42:19 -0700
Local: Wed, Apr 25 2007 3:42 pm
Subject: ActiveRecords-like validation
Hi all

One of the points that Rails ActiveRecord got right IMHO is the fact
that models should validate themselves. So I started to work on adding
rail-like validation to Elixir entities, using formencode. Here's a
first Q&D and incomplete attempt, I'm awaiting for criticism,
suggestions and other feedback.

http://sqlelixir.googlegroups.com/web/entities.py

NB : one of the main differences with ActiveRecords is that this
modules automagically adds validators based on the entity's fields.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gaetan de Menten  
View profile  
 More options Apr 25 2007, 4:03 pm
From: "Gaetan de Menten" <gdemen...@gmail.com>
Date: Wed, 25 Apr 2007 22:03:56 +0200
Local: Wed, Apr 25 2007 4:03 pm
Subject: Re: ActiveRecords-like validation
On 4/25/07, bruno.desthuilli...@gmail.com <bruno.desthuilli...@gmail.com> wrote:

> Hi all

> One of the points that Rails ActiveRecord got right IMHO is the fact
> that models should validate themselves. So I started to work on adding
> rail-like validation to Elixir entities, using formencode. Here's a
> first Q&D and incomplete attempt, I'm awaiting for criticism,
> suggestions and other feedback.

At first glance, it looks GREAT. I'll have a more thorough look
tomorrow and I'll try to think how and if we should include that
directly in Elixir.

--
Gaëtan de Menten
http://openhex.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan LaCour  
View profile  
 More options Apr 25 2007, 5:02 pm
From: Jonathan LaCour <jonathan-li...@cleverdevil.org>
Date: Wed, 25 Apr 2007 17:02:50 -0400
Local: Wed, Apr 25 2007 5:02 pm
Subject: Re: ActiveRecords-like validation

bruno.desthuilli...@gmail.com wrote:
> One of the points that Rails ActiveRecord got right IMHO is the fact
> that models should validate themselves. So I started to work on adding
> rail-like validation to Elixir entities, using formencode. Here's a
> first Q&D and incomplete attempt, I'm awaiting for criticism,
> suggestions and other feedback.

> http://sqlelixir.googlegroups.com/web/entities.py

> NB : one of the main differences with ActiveRecords is that this
> modules automagically adds validators based on the entity's fields.

Wow!

I was considering adding statements exactly like these to Elixir, but it
looks like you have done all the work for us :)

I'll take a closer look as soon as I can.  Some examples that illustrate
how to use your statements would be very helpful.

--
Jonathan LaCour
http://cleverdevil.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
黄毅  
View profile  
 More options Apr 26 2007, 1:18 am
From: "黄毅" <yi.codepla...@gmail.com>
Date: Thu, 26 Apr 2007 13:18:20 +0800
Local: Thurs, Apr 26 2007 1:18 am
Subject: Re: ActiveRecords-like validation

> One of the points that Rails ActiveRecord got right IMHO is the fact
> that models should validate themselves. So I started to work on adding
> rail-like validation to Elixir entities, using formencode. Here's a
> first Q&D and incomplete attempt, I'm awaiting for criticism,
> suggestions and other feedback.

Doesn't that kind of validation belong to form library ?

--
http://codeplayer.blogspot.com/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bruno.desthuilliers@gmail .com  
View profile  
 More options Apr 26 2007, 8:57 am
From: "bruno.desthuilli...@gmail.com" <bruno.desthuilli...@gmail.com>
Date: Thu, 26 Apr 2007 05:57:42 -0700
Local: Thurs, Apr 26 2007 8:57 am
Subject: Re: ActiveRecords-like validation

On 26 avr, 07:18, "黄毅" <yi.codepla...@gmail.com> wrote:

> > One of the points that Rails ActiveRecord got right IMHO is the fact
> > that models should validate themselves. So I started to work on adding
> > rail-like validation to Elixir entities, using formencode. Here's a
> > first Q&D and incomplete attempt, I'm awaiting for criticism,
> > suggestions and other feedback.

> Doesn't that kind of validation belong to form library ?

Nope. Forms do of course have to handle their own conversion/
validation, but this is a different issue.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bruno.desthuilliers@gmail .com  
View profile  
 More options Apr 26 2007, 3:41 pm
From: "bruno.desthuilli...@gmail.com" <bruno.desthuilli...@gmail.com>
Date: Thu, 26 Apr 2007 12:41:17 -0700
Local: Thurs, Apr 26 2007 3:41 pm
Subject: Re: ActiveRecords-like validation
Hi again

Looks like my previous answer got lost somewhere in the ether, so...

On 25 avr, 23:02, Jonathan LaCour <jonathan-li...@cleverdevil.org>
wrote:

> Wow!

> I was considering adding statements exactly like these to Elixir, but it
> looks like you have done all the work for us :)

Not quite *all* the work yet !-)

There's still a lot to do like pre/post validation hooks, more
validate_XXX statements, etc, etc, and of course test, test, test.

> I'll take a closer look as soon as I can.  Some examples that illustrate
> how to use your statements would be very helpful.

Yes, indeed. Anyway, I won't go much further without first adding real
unit-tests, so there should be working examples pretty soon now.

Gaetan : if adding a dependency on formencode is not a problem for you
(I mean you three guys), I'd of course be happy (and honored) to see
this code  becoming part of Elixir - when it'll be a bit less dirty
and a bit more tested.

Thanks you two for these first feedbacks. I'm awaiting your
observations and suggestions after a closer look.

Bruno


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gaetan de Menten  
View profile  
 More options May 3 2007, 10:47 am
From: "Gaetan de Menten" <gdemen...@gmail.com>
Date: Thu, 3 May 2007 16:47:20 +0200
Local: Thurs, May 3 2007 10:47 am
Subject: Re: ActiveRecords-like validation
On 4/26/07, bruno.desthuilli...@gmail.com <bruno.desthuilli...@gmail.com> wrote:

> Gaetan : if adding a dependency on formencode is not a problem for you
> (I mean you three guys), I'd of course be happy (and honored) to see
> this code  becoming part of Elixir - when it'll be a bit less dirty
> and a bit more tested.

Sorry for the delay. I still haven't had the opportunity to look more
closely at your code and probably won't have for some time (sorry
about that... you know... life and all that stuff).

But anyway, after giving it some thoughts, I don't thing this belongs
in. Don't get me wrong, I'm pretty sure your code is very useful (and
I'll probably use it on a later project) but if we include your code
that would be a important change of the scope of the library.

For now, it has been: "a declarative layer on top of SQLAlchemy", and
that's it nothing more.

I'm open for discussion about this, but my personal stance at the
moment is to try to keep the scope of Elixir as it is (ie quite
narrow) but fill it as well as we can rather than going in all sorts
of directions and ending up with a semi-complete-framework.

--
Gaëtan de Menten
http://openhex.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan LaCour  
View profile  
 More options May 3 2007, 11:18 am
From: Jonathan LaCour <jonathan-li...@cleverdevil.org>
Date: Thu, 3 May 2007 11:18:02 -0400
Local: Thurs, May 3 2007 11:18 am
Subject: Re: ActiveRecords-like validation

Gaetan de Menten wrote:
> Sorry for the delay. I still haven't had the opportunity to look more
> closely at your code and probably won't have for some time (sorry
> about that... you know... life and all that stuff).

Its the same response from me!  I have a lot going on right now between
life and work, so I haven't had much time to spend on Elixir in a while
:/ But, I am excited by the initial code that I have seen in your
validation statements, but haven't gone over it enough to really provide
feedback.

> I'm open for discussion about this, but my personal stance at the
> moment is to try to keep the scope of Elixir as it is (ie quite
> narrow) but fill it as well as we can rather than going in all sorts
> of directions and ending up with a semi-complete-framework.

I would be open to providing an additional egg and including details
about it on the Elixir page.  Ideally, I would like a lot of people
to start creating their own DSL statements for doing various things,
including validation, tagging, etc.  If we get enough of these rolling,
I'd like to have something on the Elixir website that lists these
"plugins" and provides a place to hold their documentation.  I'd even be
in favor of placing these plugins into our subversion repository, each
in their own separate projects.

To me, this is a great way to build up Elixir.  The core provides just
what Gaetan said: a declarative layer on top of SQLAlchemy, along with a
basis for extending it with plugins.

--
Jonathan LaCour
http://cleverdevil.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bruno.desthuilliers@gmail .com  
View profile  
 More options May 5 2007, 4:23 pm
From: "bruno.desthuilli...@gmail.com" <bruno.desthuilli...@gmail.com>
Date: Sat, 05 May 2007 13:23:24 -0700
Local: Sat, May 5 2007 4:23 pm
Subject: Re: ActiveRecords-like validation
On 3 mai, 17:18, Jonathan LaCour <jonathan-li...@cleverdevil.org>
wrote:

> Gaetan de Menten wrote:
> > Sorry for the delay. I still haven't had the opportunity to look more
> > closely at your code and probably won't have for some time (sorry
> > about that... you know... life and all that stuff).

> Its the same response from me!  I have a lot going on right now between
> life and work, so I haven't had much time to spend on Elixir in a while

Don't worry you both and don't feel sorry - I have a life too, and had
almost no time to work on this since my OP.

(snip)

All this seems quite sensible. But then it would be useful (IMHO) to
have some (more or less) standardized way to organize/package/deploy
these plugins...

My 2 cents...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bruno.desthuilliers@gmail .com  
View profile  
 More options May 9 2007, 5:16 pm
From: "bruno.desthuilli...@gmail.com" <bruno.desthuilli...@gmail.com>
Date: Wed, 09 May 2007 21:16:07 -0000
Local: Wed, May 9 2007 5:16 pm
Subject: Re: ActiveRecords-like validation
On 26 avr, 21:41, "bruno.desthuilli...@gmail.com"

And of course someone already wrote part of this:
http://pylonshq.com/pasties/244
http://beachcoder.wordpress.com/2007/05/02/adding-event-callbacks-to-...

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan LaCour  
View profile  
 More options May 9 2007, 8:07 pm
From: Jonathan LaCour <jonathan-li...@cleverdevil.org>
Date: Wed, 9 May 2007 20:07:17 -0400
Local: Wed, May 9 2007 8:07 pm
Subject: Re: ActiveRecords-like validation

bruno.desthuilli...@gmail.com wrote:
> And of course someone already wrote part of this:
> http://pylonshq.com/pasties/244

Very cool!

These statements seem like they would make wonderful additions to
elixir, and we'd just need to contact the author of the statements about
adding them in.  I would be happy to write some tests and documentation
updates for the new statements.

What does everyone (Gaetan, Daniel, etc.) think?

--
Jonathan LaCour
http://cleverdevil.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gaetan de Menten  
View profile  
 More options May 10 2007, 3:15 am
From: "Gaetan de Menten" <gdemen...@gmail.com>
Date: Thu, 10 May 2007 09:15:07 +0200
Local: Thurs, May 10 2007 3:15 am
Subject: Re: ActiveRecords-like validation
On 5/10/07, Jonathan LaCour <jonathan-li...@cleverdevil.org> wrote:

> bruno.desthuilli...@gmail.com wrote:

> > And of course someone already wrote part of this:
> > http://pylonshq.com/pasties/244

> Very cool!

> These statements seem like they would make wonderful additions to
> elixir, and we'd just need to contact the author of the statements about
> adding them in.  I would be happy to write some tests and documentation
> updates for the new statements.

> What does everyone (Gaetan, Daniel, etc.) think?

Well, I had already seen that code (notice the reference to it in the
TODO file ;-)) and I'm fully in favor of providing an easy way to
extend the mapper, but, as I said in the TODO file:

 "Beachcoder's code seem pretty cool but I wonder if it wouldn't
  be possible to do something simpler." (ie less repetitive).

Btw: I've got quite a few changes in Elixir in my pipeline... Stay tuned...
--
Gaëtan de Menten
http://openhex.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google