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

Class Package

source code


Represents a single package in a project_dir.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs) source code
 
validate_max_builds(self, field, value) source code
 
dist_git_repo(self) source code
 
source_json_dict(self) source code
 
source_type_text(self) source code
 
has_source_type_set(self)
Package's source type (and source_json) is being derived from its first build, which works except for "link" and "upload" cases.
source code
 
dist_git_url(self) source code
 
dist_git_clone_url(self) source code
 
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
 
chroot_blacklist(self) source code
 
main_pkg(self) source code
 
chroots(self) source code

Inherited from helpers.Serializer: serializable_attributes

Static Methods [hide private]
 
matched_chroot(chroot, patterns) source code
Class Variables [hide private]
  __table_args__ = db.UniqueConstraint('copr_dir_id', 'name', na...
  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...
  max_builds = db.Column(db.Integer, index= True)
  builds = db.relationship("Build", order_by= "Build.id")
  copr_id = db.Column(db.Integer, db.ForeignKey("copr.id"), inde...
  copr = db.relationship("Copr", backref= db.backref("packages"))
  copr_dir_id = db.Column(db.Integer, db.ForeignKey("copr_dir.id...
  copr_dir = db.relationship("CoprDir", backref= db.backref("pac...
  chroot_blacklist_raw = db.Column(db.Text)
Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 
Overrides: object.__init__
(inherited documentation)

validate_max_builds(self, field, value)

source code 
Decorators:
  • @validates('max_builds')

dist_git_repo(self)

source code 
Decorators:
  • @property

source_json_dict(self)

source code 
Decorators:
  • @property

source_type_text(self)

source code 
Decorators:
  • @property

has_source_type_set(self)

source code 

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.

Decorators:
  • @property

dist_git_url(self)

source code 
Decorators:
  • @property

dist_git_clone_url(self)

source code 
Decorators:
  • @property

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

chroot_blacklist(self)

source code 
Decorators:
  • @property

main_pkg(self)

source code 
Decorators:
  • @property

chroots(self)

source code 
Decorators:
  • @property

Class Variable Details [hide private]

__table_args__

Value:
db.UniqueConstraint('copr_dir_id', 'name', name= 'packages_copr_dir_pk\
gname'), db.Index('package_copr_id_name', 'copr_id', 'name'), db.Index\
('package_webhook_sourcetype', 'webhook_rebuild', 'source_type'),

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)

copr_id

Value:
db.Column(db.Integer, db.ForeignKey("copr.id"), index= True)

copr_dir_id

Value:
db.Column(db.Integer, db.ForeignKey("copr_dir.id"), index= True)

copr_dir

Value:
db.relationship("CoprDir", backref= db.backref("packages"))