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

Class Package

source code


Represents a single package in a project.

Nested Classes [hide private]
  query_class
An override for SQLAlchemy query used to do fulltext search.
Instance Methods [hide private]
 
last_build(self, successful=False) source code
 
to_dict(self, with_latest_build=False, with_latest_succeeded_build=False, with_all_builds=False)
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]
  __table_args__ = (UniqueConstraint(Column('copr_id', Integer()...
  id = db.Column(db.Integer, primary_key= True)
  name = db.Column(db.String(100), nullable= False)
  source_type = db.Column(db.Integer, default= helpers.BuildSour...
  source_json = db.Column(db.Text)
  webhook_rebuild = db.Column(db.Boolean, default= False)
  enable_net = db.Column(db.Boolean, default= False, server_defa...
  old_status = db.Column(db.Integer)
  builds = db.relationship("Build", order_by= "Build.id")
  copr_id = db.Column(db.Integer, db.ForeignKey("copr.id"))
  copr = db.relationship("Copr", backref= db.backref("packages"))
  __mapper__ = <Mapper at 0x7fee48f42a50; Package>
  __table__ = Table('package', MetaData(bind=None), Column('id',...
  __tablename__ = 'package'
  _sa_class_manager = <ClassManager of <class 'coprs.models.Pack...

Inherited from unreachable.Model: metadata

Inherited from unreachable.Model (private): _decl_class_registry

Properties [hide private]
  dist_git_repo
  source_json_dict
  source_type_text
  has_source_type_set
Package's source type (and source_json) is being derived from its first build, which works except for "srpm_link" and "srpm_upload" cases.
  dist_git_url

Inherited from helpers.Serializer: serializable_attributes

Inherited from object: __class__

Method Details [hide private]

to_dict(self, with_latest_build=False, with_latest_succeeded_build=False, with_all_builds=False)

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]

__table_args__

Value:
(UniqueConstraint(Column('copr_id', Integer(), ForeignKey('copr.id'), \
table=<package>), Column('name', String(length=100), table=<package>, \
nullable=False)))

source_type

Value:
db.Column(db.Integer, default= helpers.BuildSourceEnum("unset"))

enable_net

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

__table__

Value:
Table('package', MetaData(bind=None), Column('id', Integer(), table=<p\
ackage>, primary_key=True, nullable=False), Column('name', String(leng\
th=100), table=<package>, nullable=False), Column('source_type', Integ\
er(), table=<package>, default=ColumnDefault(0)), Column('source_json'\
, Text(), table=<package>), Column('webhook_rebuild', Boolean(), table\
=<package>, default=ColumnDefault(False)), Column('enable_net', Boolea\
n(), table=<package>, nullable=False, default=ColumnDefault(False), se\
rver_default=DefaultClause('0', for_update=False)), Column('old_status\
...

_sa_class_manager

Value:
<ClassManager of <class 'coprs.models.Package'> at 7fee48ed5178>

Property Details [hide private]

dist_git_repo

Get Method:
unreachable.dist_git_repo(self)

source_json_dict

Get Method:
unreachable.source_json_dict(self)

source_type_text

Get Method:
unreachable.source_type_text(self)

has_source_type_set

Package's source type (and source_json) is being derived from its first build, which works except for "srpm_link" and "srpm_upload" cases. Consider these being equivalent to source_type being unset.

Get Method:
unreachable.has_source_type_set(self) - Package's source type (and source_json) is being derived from its first build, which works except for "srpm_link" and "srpm_upload" cases.

dist_git_url

Get Method:
unreachable.dist_git_url(self)