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