X-Git-Url: http://git.veekun.com/zzz-floof.git/blobdiff_plain/224a257ade788e1a87aab78032dc3cdc9677cc06..b937806fb5039b4073784b576ffeb30c7fab499c:/floof/model/users.py diff --git a/floof/model/users.py b/floof/model/users.py index f51282c..6b06048 100644 --- a/floof/model/users.py +++ b/floof/model/users.py @@ -1,19 +1,18 @@ -from sqlalchemy import Column, ForeignKey -from sqlalchemy.orm import relation -from sqlalchemy.types import Integer, Unicode +# +# floof/floof/model/users.py +# +# Copyright (c) 2009 Scribblr +# -from floof.model import meta +# from elixir import Entity, Field, Unicode, belongs_to, has_many +from elixir import * -__all__ = ['User', 'IdentityURL'] +class User(Entity): + name = Field(Unicode(20)) + uploads = OneToMany('Art') + has_many('identity_urls', of_kind='IdentityURL') -class User(meta.TableBase): - __tablename__ = 'users' - id = Column(Integer, primary_key=True) - name = Column(Unicode(length=20), nullable=False) +class IdentityURL(Entity): + url = Field(Unicode(255)) + belongs_to('user', of_kind='User') -class IdentityURL(meta.TableBase): - __tablename__ = 'identity_urls' - url = Column(Unicode(length=255), primary_key=True) - user_id = Column(Integer, ForeignKey('users.id')) - -IdentityURL.user = relation(User, lazy=False, backref="identity_urls")