I recall this question being asked a few times when Elixir was first
released (perhaps even by myself). Then, we got a nice introduction to
statements [1] and all (most) those questions went away. You see,
everything in Elixir is a DSL statement, which makes it very simple,
yet powerful. I suppose it's would be possible to alter the syntax,
but see the first half of this previous discussion [2] before pressing
on.

Hope that answers your questions.

[1]: http://cleverdevil.org/computing/52/
[2]:http://groups.google.com/group/sqlelixir/browse_thread/thread/29dcb0ee987952d1/

On 7/27/07, Adam Atlas <[EMAIL PROTECTED]> wrote:
>
> I'm sorry if this has already been discussed before; I searched and
> couldn't find much.
>
> I was wondering why Elixir does not support the fieldname =
> ColumnType(...) style of field declaration (while ActiveMapper and
> TurboEntity did). Comparing these two instances (based on the example
> on the site)...
>
> class User(Entity):
>     has_field('user_id', Integer, primary_key=True)
>     has_field('user_name', Unicode(16), unique=True)
>     has_field('email_address', Unicode(255), unique=True)
>     has_field('display_name', Unicode(255))
>     has_field('password', Unicode(40))
>     has_field('created', DateTime, default=datetime.now)
>
> class User(Entity):
>     user_id = Integer(primary_key=True)
>     user_name = Unicode(16, unique=True)
>     email_address = Unicode(255, unique=True)
>     display_name = Unicode(255)
>     password = Unicode(40)
>     created = DateTime(default=datetime.now)
>
> ...I think the latter looks much nicer and more Pythonic. It seems
> like if it existed, it would be the One Obvious Way. I don't even see
> how has_field or with_fields have any advantages over this.
>
> Thoughts?
>
>
> >
>


-- 
----
Waylan Limberg
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
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