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

Class Copr

source code


Represents a single copr (private repo with builds, mock chroots, etc.).

Nested Classes [hide private]
  query_class
An override for SQLAlchemy query used to do fulltext search.
Instance Methods [hide private]
 
is_release_arch_modified(self, name_release, arch) source code
 
to_dict(self, private=False, show_builds=True, show_chroots=True)
Usage:
source code
 
get_search_related_copr_id(self) source code
 
__init__(self, **kwargs)
A simple constructor that allows initialization from kwargs.
source code

Inherited from unreachable.Model: query

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)
  name = db.Column(db.String(100), nullable= False)
  homepage = db.Column(db.Text)
  contact = db.Column(db.Text)
  repos = db.Column(db.Text)
  created_on = db.Column(db.Integer)
  description = db.Column(db.Text)
  instructions = db.Column(db.Text)
  deleted = db.Column(db.Boolean, default= False)
  playground = db.Column(db.Boolean, default= False)
  auto_createrepo = db.Column(db.Boolean, default= True)
  user_id = db.Column(db.Integer, db.ForeignKey("user.id"))
  user = db.relationship("User", backref= db.backref("coprs"))
  group_id = db.Column(db.Integer, db.ForeignKey("group.id"))
  group = db.relationship("Group", backref= db.backref("groups"))
  mock_chroots = association_proxy("copr_chroots", "mock_chroot")
  forked_from_id = db.Column(db.Integer, db.ForeignKey("copr.id"))
  forked_from = db.relationship("Copr", remote_side= id, backref...
  webhook_secret = db.Column(db.String(100))
  build_enable_net = db.Column(db.Boolean, default= True, server...
  unlisted_on_hp = db.Column(db.Boolean, default= False, nullabl...
  latest_indexed_data_update = db.Column(db.Integer)
  persistent = db.Column(db.Boolean, default= False, nullable= F...
  auto_prune = db.Column(db.Boolean, default= True, nullable= Fa...
  __mapper_args__ = {"order_by": created_on.desc()}
  __mapper__ = <Mapper at 0x7fee48f1a750; Copr>
  __table__ = Table('copr', MetaData(bind=None), Column('id', In...
  __tablename__ = 'copr'
  _sa_class_manager = <ClassManager of <class 'coprs.models.Copr...

Inherited from unreachable.Model: metadata

Inherited from unreachable.Model (private): _decl_class_registry

Properties [hide private]
  is_a_group_project
Return True if copr belongs to a group
  owner
Return owner (user or group) of this copr
  owner_name
Return @group.name for a copr owned by a group and user.name otherwise
  repos_list
Return repos of this copr as a list of strings
  active_chroots
Return list of active mock_chroots of this copr
  active_copr_chroots
:rtype: list of CoprChroot
  active_chroots_sorted
Return list of active mock_chroots of this copr
  active_chroots_grouped
Return list of active mock_chroots of this copr
  build_count
Return number of builds in this copr
  disable_createrepo
  modified_chroots
Return list of chroots which has been modified
  full_name
  repo_name
  repo_url
  repo_id
  modules_url
  still_forking

Inherited from helpers.Serializer: serializable_attributes

Inherited from object: __class__

Method Details [hide private]

to_dict(self, private=False, show_builds=True, show_chroots=True)

source code 

Usage:

SQLAlchObject.to_dict() => returns a flat dict of the object
SQLAlchObject.to_dict({"foo": {}}) => returns a dict of the object
    and will include a flat dict of object foo inside of that
SQLAlchObject.to_dict({"foo": {"bar": {}}, "spam": {}}) => returns
    a dict of the object, which will include dict of foo
    (which will include dict of bar) and dict of spam.

Options can also contain two special values: __columns_only__
and __columns_except__

If present, the first makes only specified fiels appear,
the second removes specified fields. Both of these fields
must be either strings (only works for one field) or lists
(for one and more fields).

SQLAlchObject.to_dict({"foo": {"__columns_except__": ["id"]},
    "__columns_only__": "name"}) =>

The SQLAlchObject will only put its "name" into the resulting dict,
while "foo" all of its fields except "id".

Options can also specify whether to include foo_id when displaying
related foo object (__included_ids__, defaults to True).
This doesn"t apply when __columns_only__ is specified.

Overrides: helpers.Serializer.to_dict
(inherited documentation)

get_search_related_copr_id(self)

source code 
Overrides: CoprSearchRelatedData.get_search_related_copr_id

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

forked_from

Value:
db.relationship("Copr", remote_side= id, backref= db.backref("forks"))

build_enable_net

Value:
db.Column(db.Boolean, default= True, server_default= "1", nullable= Fa\
lse)

unlisted_on_hp

Value:
db.Column(db.Boolean, default= False, nullable= False)

persistent

Value:
db.Column(db.Boolean, default= False, nullable= False, server_default=\
 "0")

auto_prune

Value:
db.Column(db.Boolean, default= True, nullable= False, server_default= \
"1")

__table__

Value:
Table('copr', MetaData(bind=None), Column('id', Integer(), table=<copr\
>, primary_key=True, nullable=False), Column('name', String(length=100\
), table=<copr>, nullable=False), Column('homepage', Text(), table=<co\
pr>), Column('contact', Text(), table=<copr>), Column('repos', Text(),\
 table=<copr>), Column('created_on', Integer(), table=<copr>), Column(\
'description', Text(), table=<copr>), Column('instructions', Text(), t\
able=<copr>), Column('deleted', Boolean(), table=<copr>, default=Colum\
nDefault(False)), Column('playground', Boolean(), table=<copr>, defaul\
...

_sa_class_manager

Value:
<ClassManager of <class 'coprs.models.Copr'> at 7fee48fc2618>

Property Details [hide private]

is_a_group_project

Return True if copr belongs to a group

Get Method:
unreachable.is_a_group_project(self) - Return True if copr belongs to a group

owner

Return owner (user or group) of this copr

Get Method:
unreachable.owner(self) - Return owner (user or group) of this copr

owner_name

Return @group.name for a copr owned by a group and user.name otherwise

Get Method:
unreachable.owner_name(self) - Return @group.name for a copr owned by a group and user.name otherwise

repos_list

Return repos of this copr as a list of strings

Get Method:
unreachable.repos_list(self) - Return repos of this copr as a list of strings

active_chroots

Return list of active mock_chroots of this copr

Get Method:
unreachable.active_chroots(self) - Return list of active mock_chroots of this copr

active_copr_chroots

:rtype: list of CoprChroot

Get Method:
unreachable.active_copr_chroots(self) - :rtype: list of CoprChroot

active_chroots_sorted

Return list of active mock_chroots of this copr

Get Method:
unreachable.active_chroots_sorted(self) - Return list of active mock_chroots of this copr

active_chroots_grouped

Return list of active mock_chroots of this copr

Get Method:
unreachable.active_chroots_grouped(self) - Return list of active mock_chroots of this copr

build_count

Return number of builds in this copr

Get Method:
unreachable.build_count(self) - Return number of builds in this copr

disable_createrepo

Get Method:
unreachable.disable_createrepo(self)
Set Method:
unreachable.disable_createrepo(self, value)

modified_chroots

Return list of chroots which has been modified

Get Method:
unreachable.modified_chroots(self) - Return list of chroots which has been modified

full_name

Get Method:
unreachable.full_name(self)

repo_name

Get Method:
unreachable.repo_name(self)

repo_url

Get Method:
unreachable.repo_url(self)

repo_id

Get Method:
unreachable.repo_id(self)

modules_url

Get Method:
unreachable.modules_url(self)

still_forking

Get Method:
unreachable.still_forking(self)