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]

Inherited from flask_sqlalchemy.Model: query_class

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_build_in_group(self, group)
:type group: Group
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 Variables [hide private]
  id = db.Column(db.Integer, primary_key= True)
  username = db.Column(db.String(100), nullable= False, unique= ...
  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...
  openid_groups = db.Column(JSONEncodedDict)
  __mapper__ = <Mapper at 0x7fee48fa7190; 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.
  user_teams
  user_groups
  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

__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]

username

Value:
db.Column(db.String(100), nullable= False, unique= True)

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('username', String(length\
=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=Col\
umnDefault(False)), Column('admin', Boolean(), table=<user>, default=C\
olumnDefault(False)), Column('api_login', String(length=40), table=<us\
er>, nullable=False, default=ColumnDefault('abc')), Column('api_token'\
...

_sa_class_manager

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

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.

user_teams

Get Method:
unreachable.user_teams(self)

user_groups

Get Method:
unreachable.user_groups(self)

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.