Package coprs :: Module models :: Class User
[hide private]
[frames] | no frames]

Class User

source code


Represents user of the copr frontend

Nested Classes [hide private]
  query_class
An override for SQLAlchemy query used to do fulltext search.
Instance Methods [hide private]
 
permissions_for_copr(self, copr)
Get permissions of this user for the given copr.
source code
 
can_build_in(self, copr)
Determine if this user can build in the given copr.
source code
 
can_edit(self, copr)
Determine if this user can edit the given copr.
source code
 
__init__(self, **kwargs)
A simple constructor that allows initialization from kwargs.
source code

Inherited from unreachable.Model: query

Inherited from helpers.Serializer: to_dict

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
openidize_name(cls, name)
Create proper openid_name from short name.
source code
Class Variables [hide private]
  id = db.Column(db.Integer, primary_key= True)
  openid_name = db.Column(db.String(100), nullable= False)
  mail = db.Column(db.String(150), nullable= False)
  timezone = db.Column(db.String(50), nullable= True)
  proven = db.Column(db.Boolean, default= False)
  admin = db.Column(db.Boolean, default= False)
  api_login = db.Column(db.String(40), nullable= False, default=...
  api_token = db.Column(db.String(40), nullable= False, default=...
  api_token_expiration = db.Column(db.Date, nullable= False, def...
  __mapper__ = <Mapper at 0xf573a18c; User>
  __table__ = Table('user', MetaData(bind=None), Column('id', In...
  __tablename__ = 'user'
  _sa_class_manager = <ClassManager of <class 'coprs.models.User...

Inherited from unreachable.Model: metadata

Inherited from unreachable.Model (private): _decl_class_registry

Properties [hide private]
  name
Return the short username of the user, e.g.
  serializable_attributes
  coprs_count
Get number of coprs for this user.
  gravatar_url
Return url to libravatar image.

Inherited from object: __class__

Method Details [hide private]

permissions_for_copr(self, copr)

source code 

Get permissions of this user for the given copr. Caches the permission during one request, so use this if you access them multiple times

openidize_name(cls, name)
Class Method

source code 

Create proper openid_name from short name.

>>> user.openid_name == User.openidize_name(user.name)
True

__init__(self, **kwargs)
(Constructor)

source code 

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in ``kwargs``.

Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships.

Overrides: object.__init__

Class Variable Details [hide private]

api_login

Value:
db.Column(db.String(40), nullable= False, default= "abc")

api_token

Value:
db.Column(db.String(40), nullable= False, default= "abc")

api_token_expiration

Value:
db.Column(db.Date, nullable= False, default= datetime.date(2000, 1, 1)\
)

__table__

Value:
Table('user', MetaData(bind=None), Column('id', Integer(), table=<user\
>, primary_key=True, nullable=False), Column('openid_name', String(len\
gth=100), table=<user>, nullable=False), Column('mail', String(length=\
150), table=<user>, nullable=False), Column('timezone', String(length=\
50), table=<user>), Column('proven', Boolean(), table=<user>, default=\
ColumnDefault(False)), Column('admin', Boolean(), table=<user>, defaul\
t=ColumnDefault(False)), Column('api_login', String(length=40), table=\
<user>, nullable=False, default=ColumnDefault('abc')), Column('api_tok\
...

_sa_class_manager

Value:
<ClassManager of <class 'coprs.models.User'> at f5818a4c>

Property Details [hide private]

name

Return the short username of the user, e.g. bkabrda

Get Method:
unreachable.name(self) - Return the short username of the user, e.g.

serializable_attributes

Get Method:
unreachable.serializable_attributes(self)

coprs_count

Get number of coprs for this user.

Get Method:
unreachable.coprs_count(self) - Get number of coprs for this user.

gravatar_url

Return url to libravatar image.

Get Method:
unreachable.gravatar_url(self) - Return url to libravatar image.