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

Class User

source code


Represents user of the copr frontend

Instance Methods [hide private]
 
name(self)
Returns the short username of the user, e.g.
source code
 
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
 
serializable_attributes(self) source code
 
coprs_count(self)
Get number of coprs for this user.
source code
 
gravatar_url(self)
Return url to libravatar image.
source code

Inherited from Serializer: to_dict

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

Class Methods [hide private]
 
openidize_name(cls, name)
Creates 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)
  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...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

name(self)

source code 

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

Decorators:
  • @property

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 

Creates proper openid_name from short name.

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

serializable_attributes(self)

source code 
Decorators:
  • @property
Overrides: Serializer.serializable_attributes

coprs_count(self)

source code 

Get number of coprs for this user.

Decorators:
  • @property

gravatar_url(self)

source code 

Return url to libravatar image.

Decorators:
  • @property

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)\
)