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

_BoundDeclarativeMeta Package

source code


Represents a single package in a project.

Nested Classes [hide private]
query_class
The default query object used for models, and exposed as :attr:`~SQLAlchemy.Query`.
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

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 0xf51617ac; 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 "link" and "upload" cases.
  dist_git_url
  dist_git_clone_url

Inherited from helpers.Serializer: serializable_attributes

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 fields 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: unreachable.Model-1.__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 f515cadc>

Property Details [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 "link" and "upload" cases. Consider these being equivalent to source_type being unset.

dist_git_url

dist_git_clone_url