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

_BoundDeclarativeMeta Build

source code


Representation of one build in one copr

Nested Classes [hide private]

Inherited from flask_sqlalchemy.Model: query_class

Instance Methods [hide private]
 
get_chroots_by_status(self, statuses=None)
Get build chroots with states which present in `states` list If states == None, function returns build_chroots
source code
 
to_dict(self, options=None, with_chroot_states=False)
Usage:
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__ = (Index('build_canceled', Column('canceled', B...
  id = db.Column(db.Integer, primary_key= True)
  pkgs = db.Column(db.Text)
  built_packages = db.Column(db.Text)
  pkg_version = db.Column(db.Text)
  canceled = db.Column(db.Boolean, default= False)
  repos = db.Column(db.Text)
  submitted_on = db.Column(db.Integer, nullable= False)
  results = db.Column(db.Text)
  memory_reqs = db.Column(db.Integer, default= constants.DEFAULT...
  timeout = db.Column(db.Integer, default= constants.DEFAULT_BUI...
  enable_net = db.Column(db.Boolean, default= False, server_defa...
  source_type = db.Column(db.Integer, default= helpers.BuildSour...
  source_json = db.Column(db.Text)
  fail_type = db.Column(db.Integer, default= helpers.FailTypeEnu...
  is_background = db.Column(db.Boolean, default= False, server_d...
  user_id = db.Column(db.Integer, db.ForeignKey("user.id"))
  user = db.relationship("User", backref= db.backref("builds"))
  copr_id = db.Column(db.Integer, db.ForeignKey("copr.id"))
  copr = db.relationship("Copr", backref= db.backref("builds"))
  package_id = db.Column(db.Integer, db.ForeignKey("package.id"))
  package = db.relationship("Package")
  chroots = association_proxy("build_chroots", "mock_chroot")
  __mapper__ = <Mapper at 0x3fffae781310; Build>
  __table__ = Table('build', MetaData(bind=None), Column('id', I...
  __tablename__ = 'build'
  _sa_class_manager = <ClassManager of <class 'coprs.models.Buil...

Inherited from unreachable.Model: metadata

Inherited from unreachable.Model (private): _decl_class_registry

Properties [hide private]
  user_name
  group_name
  copr_name
  fail_type_text
  is_older_results_naming_used
  repos_list
  import_task_id
  import_log_url
  result_dir_name
  source_json_dict
  started_on
  min_started_on
  ended_on
  max_ended_on
  chroots_started_on
  chroots_ended_on
  source_type_text
  source_metadata
  chroot_states
  chroots_dict_by_name
  has_pending_chroot
  has_unfinished_chroot
  has_importing_chroot
  status
Return build status according to build status of its chroots
  state
Return text representation of status of this build
  cancelable
Find out if this build is cancelable.
  repeatable
Find out if this build is repeatable.
  finished
Find out if this build is in finished state.
  persistent
Find out if this build is persistent.
  src_pkg_name
Extract source package name from source name or url todo: obsolete
  package_name

Inherited from helpers.Serializer: serializable_attributes

Method Details [hide private]

to_dict(self, options=None, with_chroot_states=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)

__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:
(Index('build_canceled', Column('canceled', Boolean(), table=<build>, \
default=ColumnDefault(False))))

memory_reqs

Value:
db.Column(db.Integer, default= constants.DEFAULT_BUILD_MEMORY)

timeout

Value:
db.Column(db.Integer, default= constants.DEFAULT_BUILD_TIMEOUT)

enable_net

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

source_type

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

fail_type

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

is_background

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

__table__

Value:
Table('build', MetaData(bind=None), Column('id', Integer(), table=<bui\
ld>, primary_key=True, nullable=False), Column('pkgs', Text(), table=<\
build>), Column('built_packages', Text(), table=<build>), Column('pkg_\
version', Text(), table=<build>), Column('canceled', Boolean(), table=\
<build>, default=ColumnDefault(False)), Column('repos', Text(), table=\
<build>), Column('submitted_on', Integer(), table=<build>, nullable=Fa\
lse), Column('results', Text(), table=<build>), Column('memory_reqs', \
Integer(), table=<build>, default=ColumnDefault(2048)), Column('timeou\
...

_sa_class_manager

Value:
<ClassManager of <class 'coprs.models.Build'> at 3fffae7864f0>

Property Details [hide private]

user_name

group_name

copr_name

fail_type_text

is_older_results_naming_used

repos_list

import_task_id

import_log_url

result_dir_name

source_json_dict

started_on

min_started_on

ended_on

max_ended_on

chroots_started_on

chroots_ended_on

source_type_text

source_metadata

chroot_states

chroots_dict_by_name

has_pending_chroot

has_unfinished_chroot

has_importing_chroot

status

Return build status according to build status of its chroots

state

Return text representation of status of this build

cancelable

Find out if this build is cancelable.

Build is cancelabel only when it's pending (not started)

repeatable

Find out if this build is repeatable.

Build is repeatable only if it's not pending, starting or running

finished

Find out if this build is in finished state.

Build is finished only if all its build_chroots are in finished state.

persistent

Find out if this build is persistent.

This property is inherited from the project.

src_pkg_name

Extract source package name from source name or url todo: obsolete

package_name