collecting_society_web.models package

Submodules

collecting_society_web.models.artist module

class collecting_society_web.models.artist.Artist[source]

Bases: Tdb, MixinWebuser

Model wrapper for Tryton model object ‘artist’

classmethod create(vlist)[source]

Creates artists

Parameters:

vlist (list) –

list of dicts with attributes to create artists:

[
    {
        'party': party.party (required)
        'group': bool (required)
        'name': str (required),
        'description': str,
        'picture_data': Binary,
        'picture_data_mime_type': str
    },
    {
        ...
    }
]

Raises:

KeyError – if required field is missing

Returns:

created artists None: if no object was created

Return type:

list

classmethod create_foreign(party, name, email, group=False)[source]

Creates foreign Artist

Parameters:
  • party – the Party that wants to create the foreign objects

  • name – the artist name of the foreign artist object

  • email – the artist email of the foreign artist object

Returns:

the artist that has been created None: if no object was created

Return type:

Artist object

classmethod delete(artist)[source]

Deletes artist

Parameters:

artist (list) –

artists:

[artist1, artist2, ...]

Returns:

?

classmethod is_foreign_contributor(request, contribution, artist)[source]

Checks if the artist is a foreign object and still editable by the current webuser.

Checks, if the member
  1. is a foreign object

  2. is still not claimed yet

  3. is editable by the current web user

  4. TODO: was not part of a distribution yet

Parameters:
  • request (pyramid.request.Request) – Current request.

  • contribution (obj) – Contribution of the artist

  • artist (obj) – Artist to check.

Returns:

if member is editable. false: otherwise.

Return type:

true

classmethod is_foreign_member(request, group, member)[source]

Checks if the member is a foreign object and still editable by the current webuser.

Checks, if the member
  1. is a foreign object

  2. is still not claimed yet

  3. is editable by the current web user

  4. TODO: was not part of a distribution yet

Parameters:
  • request (pyramid.request.Request) – Current request.

  • group (obj) – Group of the member in the current context

  • member (obj) – Member to check.

Returns:

if member is editable. false: otherwise.

Return type:

true

classmethod is_foreign_rightsholder(request, right, artist)[source]

Checks if the artist is a foreign object and still editable by the current webuser.

Checks, if the member
  1. is a foreign object

  2. is still not claimed yet

  3. is editable by the current web user

  4. TODO: was not part of a distribution yet

Parameters:
  • request (pyramid.request.Request) – Current request.

  • right (obj) – Right object.

  • artist (obj) – Artist to check.

Returns:

if member is editable. false: otherwise.

Return type:

true

classmethod search(domain, offset=None, limit=None, order=None, escape=False, active=True)[source]

Searches artists by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

list of artists

Return type:

obj

classmethod search_all(active=True)[source]

Fetches all Artists

Returns:

artist None: if no match is found

Return type:

list

classmethod search_all_solo_artists(active=True)[source]

Fetches all solo artists

Parameters:

active (bool) – only active artists?

Returns:

all solo artists None: if no match is found

Return type:

list

classmethod search_by_code(artist_code, active=True)[source]

Searches an artist by artist code

Parameters:

artist_code (int) – artist.code

Returns:

artist None: if no match is found

Return type:

obj

classmethod search_by_id(artist_id, active=True)[source]

Searches an artist by artist id

Note

We don’t want our internal ids to be exposed to the world. So better use search_by_oid().

Parameters:

artist_id (int) – artist.id

Returns:

artist None: if no match is found

Return type:

obj

classmethod search_by_name(artist_name, active=True)[source]

Searches artists by artist name

Parameters:

artist_name (str) – artist.name

Returns:

list of artists

Return type:

obj

classmethod search_by_oid(oid, active=True)[source]

Searches an artist by oid (public api id)

Parameters:

oid (int) – artist.oid

Returns:

artist None: if no match is found

Return type:

obj

classmethod search_by_party(party_id, active=True)[source]

Searches artists by party id

Parameters:

party_id (int) – party.party.id

Returns:

artists of web_user None: if no match is found

Return type:

list

classmethod search_count(domain, escape=False, active=True)[source]

Counts artists by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

number of artists

Return type:

int

classmethod search_fulltext(search_string, active=True)[source]

Searches artists by fulltext search of - code - name - description

Parameters:

search_string (str) – string to search for

Returns:

list of artists

Return type:

obj

classmethod search_group_artists_by_party(party_id, active=True)[source]

Searches group artists by party id

Parameters:

party_id (int) – party.party.id

Returns:

group artists of web_user None: if no match is found

Return type:

list

classmethod search_solo_artists_by_party(party_id, active=True)[source]

Searches solo artists by party id

Parameters:

party_id (int) – party.party.id

Returns:

solo artists of web_user None: if no match is found

Return type:

list

collecting_society_web.models.artist_identifier module

class collecting_society_web.models.artist_identifier.ArtistIdentifier[source]

Bases: Tdb

Model wrapper for Tryton model object ‘artist_identifier’

classmethod search_all()[source]

Fetches all ArtistIdentifiers

Returns:

artist_identifiers None: if no match is found

Return type:

list

classmethod search_by_code(id_code)[source]

Searches all foreign artist_identifiers for a given native id_code

Note

This is the preferred method of accessing an identifier. Only if id_space and id_code are both provided, an object can be determined with certainty.

Parameters:

id_code (string) – artist_identifier.id_code

Returns:

artist_identifier list None: if no match is found

Return type:

obj

classmethod search_by_id(id)[source]

Searches a artist_identifier by id

Parameters:

id (int) – artist_identifier.id

Note

This is a search for the internal database id, not the id_code of a certaion id_space.

Returns:

artist_identifier None: if no match is found

Return type:

obj

classmethod search_by_spacecode(id_space, id_code)[source]

Searches a artist_identifier in certain id_space by given id_code

Note

This is the preferred method of accessing an identifier. Only if id_space and id_code are bothe provided, an object can be determined with certainty.

Parameters:
  • id_code (string) – artist_identifier.id_code

  • id_space (string) – artist_identifier.id_space

Returns:

artist_identifier None: if no match is found

Return type:

obj

collecting_society_web.models.artist_identifier_space module

class collecting_society_web.models.artist_identifier_space.ArtistIdentifierSpace[source]

Bases: Tdb

Model wrapper for Tryton model object ‘artist.cs_identifier_space’

classmethod search_all()[source]

Fetches all ArtistIdentifierSpaces

Returns:

artist_identifier_spaces None: if no match is found

Return type:

list

classmethod search_by_id(id)[source]

Searches a artist_identifier_space by id

Parameters:

id (int) – artist_identifier_space.id

Returns:

artist_identifier_space None: if no match is found

Return type:

obj

classmethod search_by_name(name)[source]

Searches a artist_identifier_space by name

Parameters:

name (string) – artist_identifier_space.name

Returns:

artist_identifier_space None: if no match is found

Return type:

obj

collecting_society_web.models.artist_playlist module

class collecting_society_web.models.artist_playlist.ArtistPlaylist[source]

Bases: Tdb, MixinSearchById

Model wrapper for Tryton model object ‘artist.playlist’

collecting_society_web.models.collecting_society module

class collecting_society_web.models.collecting_society.CollectingSociety[source]

Bases: Tdb

Model wrapper for Tryton model object ‘collecting_society’

classmethod search(domain, offset=None, limit=None, order=None, escape=False, active=True)[source]

Searches collecting societies by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

list of collecting societies

Return type:

obj

classmethod search_all()[source]

Fetches all collecting societies

Returns:

collecting societies None: if no match is found

Return type:

list

classmethod search_by_id(collecting_society_id)[source]

Searches a collecting society by id

Parameters:

collecting_society_id (int) – collecting_society.id

Returns:

collecting society None: if no match is found

Return type:

obj

classmethod search_by_oid(oid, active=True)[source]

Searches a collecting society by oid (public api id)

Parameters:

oid (int) – collecting_society.oid

Returns:

collecting society None: if no match is found

Return type:

obj

collecting_society_web.models.content module

class collecting_society_web.models.content.Content[source]

Bases: Tdb

Model wrapper for Tryton model object ‘web.user’.

classmethod create(vlist)[source]

Creates content.

Parameters:

vlist (list) –

List of dictionaries with attributes of a content. [

{

‘active’: bool, ‘uuid’: str (required), ‘name’: str (required), ‘size’: int, ‘path’: str, ‘preview_path’: str, ‘mime_type’: str, ‘mediation’: bool, ‘duplicate_of’: int, ‘duplicates’: list, ‘entity_origin’: str (required), ‘entity_creator’: str (required), ‘user_committed_state’: bool, ‘fingerprintlogs’: list, ‘checksums’: list, ‘archive’: int, ‘category’: str (required), ‘creation’: int, ‘processing_state’: str, ‘processing_hostname’: str, ‘rejection_reason’: str, ‘length’: float, ‘channels’: int, ‘sample_rate’: int, ‘sample_width’: int

}, {

}

]

Returns:

List of created content. None: If no object was created.

Return type:

list (obj[content])

Raises:

KeyError – If required field is missing.

classmethod current_orphans(request, category='all')[source]

Searches orphan content in category of current web user.

Parameters:
  • request (pyramid.request.Request) – Current request.

  • category (str) – optional - Category of content.

Returns:

List of content. None: If no match is found.

Return type:

list (content)

classmethod current_rejects(request, reason, category='all')[source]

Searches rejected content (optionally in category) of current web user.

Parameters:
  • request (pyramid.request.Request) – Current request.

  • reason (str) – Reason for rejected content.

  • category (str) – optional - Category of content.

Returns:

List of content. None: If no match is found.

Return type:

list (content)

classmethod current_uncommits(request, category='all')[source]

Searches uncommited content (optionally in category) of current web user.

Parameters:
  • request (pyramid.request.Request) – Current request.

  • category (str) – optional - Category of content.

Returns:

List of content. None: If no match is found.

Return type:

list (content)

classmethod current_viewable(request)[source]

Searches content, which the current web_user is allowed to view.

Parameters:

request (pyramid.request.Request) – Current request.

Returns:

viewable content of web_user None: if no match is found

Return type:

list

classmethod delete(content)[source]

Deletes content

Parameters:

content (list) –

contents:

[content1, content2, ...]

Returns:

?

classmethod search(domain, offset=None, limit=None, order=None, escape=False, active=True)[source]

Searches content entries by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

list of content entries

Return type:

obj

classmethod search_all()[source]

Gets all content.

Returns:

List of content. None: if no match is found.

Return type:

list (obj[content])

classmethod search_by_archive(archive)[source]

Searches a content by archive.

Parameters:

archive (int) – Id of the archive.

Returns:

List of content.

Return type:

list (content)

classmethod search_by_code(content_code, active=True)[source]

Searches a content by content code

Parameters:

content_code (int) – content.code

Returns:

content None: if no match is found

Return type:

obj

classmethod search_by_creation(creation_id)[source]

Searches a content by creation id.

Parameters:

creation_id (int) – Id of the creation.

Returns:

Content. None: If no match is found.

Return type:

obj (content)

classmethod search_by_creation_and_category(creation_id, category)[source]

Searches a content by creation id and content category.

Parameters:
  • creation_id (int) – Id of the creation.

  • category (strint) – e.g. ‘audio’ oder ‘sheet’

Returns:

Content. None: If no match is found.

Return type:

obj (content)

classmethod search_by_extension(extension)[source]

Searches a content by extension.

Parameters:

extension (str) – Extension of the content.

Returns:

List of content.

Return type:

list (content)

classmethod search_by_id(uid)[source]

Searches a content by id.

Parameters:

uid (string) – Id of the content.

Returns:

Content. None: If no match is found.

Return type:

obj (content)

classmethod search_by_mime_type(mime_type)[source]

Searches a content by mime type.

Parameters:

mime_type (str) – Mime type of the content.

Returns:

List of content.

Return type:

list (content)

classmethod search_by_name(name)[source]

Searches a content by name.

Parameters:

name (str) – Name of the content.

Returns:

List of content.

Return type:

list (content)

classmethod search_by_oid(oid, active=True)[source]

Searches a content by oid (public api id)

Parameters:

oid (int) – content.oid

Returns:

content None: if no match is found

Return type:

obj

classmethod search_by_party(party_id)[source]

Searches a content by party id.

Parameters:

party_id (int) – Id of the party.

Returns:

List of content.

Return type:

list (content)

classmethod search_by_uuid(uuid)[source]

Searches a content by uuid.

Parameters:

uuid (str) – Uuid of the content.

Returns:

Content. None: If no match is found.

Return type:

obj (content)

classmethod search_by_web_user(web_user_id)[source]

Searches a content by web user id.

Parameters:

web_user_id (int) – Id of the user.

Returns:

List of content.

Return type:

list (content)

classmethod search_count(domain, escape=False, active=True)[source]

Counts content entries by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

number of content entries

Return type:

int

classmethod search_orphans(party_id, category)[source]

Searches orphan content in category of web user.

Parameters:
  • cls (pyramid.request.Request) – Current request.

  • party_id (int) – Res user id.

  • category (str) – Category of content.

Returns:

List of content. None: If no match is found.

Return type:

list (content)

classmethod search_rejects(party_id, reason, category)[source]

Searches duplicate content of current user.

Parameters:
  • cls (pyramid.request.Request) – Current request.

  • party_id (int) – Res user id.

  • reason (str) – Reason for rejected content.

  • category (str) – Category of content.

Returns:

List of content. None: If no match is found.

Return type:

list (content)

classmethod search_uncommits(party_id, category)[source]

Searches uncommited content of current user.

Parameters:
  • cls (pyramid.request.Request) – Current request.

  • party_id (int) – Res user id.

  • category (str) – Category of content.

Returns:

List of content. None: If no match is found.

Return type:

list (content)

classmethod search_unprocessed(party_id, category)[source]

Searches unprocessed content in category of web user.

Parameters:
  • cls (pyramid.request.Request) – Current request.

  • party_id (int) – Res user id.

  • category (str) – Category of content.

Returns:

List of content. None: If no match is found.

Return type:

list (content)

classmethod search_viewable_by_web_user(web_user_id, active=True)[source]

Searches artists, which the web_user is allowed to view.

Parameters:

web_user_id (int) – web.user.id

Returns:

viewable artists of web_user, empty if none were found

Return type:

list

collecting_society_web.models.creation module

class collecting_society_web.models.creation.Creation[source]

Bases: Tdb

Model wrapper for Tryton model object ‘creation’

classmethod create(vlist)[source]

Creates creations

Parameters:

vlist (list) –

list of dicts with attributes to create creations:

[
    {
        'title': str (required)
        'artist': int artist.id (required)
        ...2DO
    },
    {
        ...
    }
]

Raises:

KeyError – if required field is missing

Returns:

created creations None: if no object was created

Return type:

list

classmethod create_foreign(party, artist_name, title)[source]

Creates foreign Artist(!) and Creaion

Parameters:
  • party – the Party that wants to create the foreign objects

  • artist_name – the artist name of the foreign artist object

  • title – the original title of the foreign creation object

Returns:

the creation that has been creation None: if no object was created

Return type:

Creation object

classmethod current_viewable(request)[source]

Searches creations, which the current web_user is allowed to view.

Parameters:

request (pyramid.request.Request) – Current request.

Returns:

viewable creations of current web_user None: if no match is found

Return type:

list

classmethod delete(creation)[source]

Deletes creation

Parameters:

creation (list) –

creations:

[creation1, creation2, ...]

Returns:

?

classmethod is_foreign_creation(web_user, creation)[source]

Checks if the creation is a foreign object and still editable by the current webuser.

Checks, if the creation
  1. is a foreign object

  2. is still not claimed yet

  3. is editable by the current web user

  4. TODO: was not part of a distribution yet

Parameters:
  • request (pyramid.request.Request) – Current request.

  • release (obj) – Release of track.

  • track (obj) – Track creation of release.

Returns:

if orignal is foreign and editable. false: otherwise.

Return type:

true

classmethod is_foreign_original(request, derivative, original)[source]

Checks if the original is a foreign object and still editable by the current webuser.

Checks, if the original
  1. is a foreign object

  2. is still not claimed yet

  3. is editable by the current web user

  4. TODO: was not part of a distribution yet

Parameters:
  • request (pyramid.request.Request) – Current request.

  • derivative (obj) – Derived creation.

  • original (obj) – Original creation.

Returns:

if orignal is foreign and editable. false: otherwise.

Return type:

true

classmethod is_foreign_track(web_user, release, creation)[source]

Checks if the track is a foreign object and still editable by the current webuser.

Checks, if the creation
  1. is a foreign object

  2. is still not claimed yet

  3. is editable by the current web user

  4. TODO: was not part of a distribution yet

Parameters:
  • request (pyramid.request.Request) – Current request.

  • release (obj) – Release of track.

  • creation (obj) – Track creation of release.

Returns:

if orignal is foreign and editable. false: otherwise.

Return type:

true

classmethod search(domain, offset=None, limit=None, order=None, escape=False, active=True)[source]

Searches creations by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

list of creations

Return type:

obj

classmethod search_all(active=True)[source]

Fetches all Creations

Parameters:

active (bool, optional) – active records only? Defaults to True.

Returns:

creation None: if no match is found

Return type:

list

classmethod search_by_artist(artist_id, active=True)[source]

Searches creations by artist id

Parameters:
  • artist_id (int) – artist.id

  • active (bool, optional) – active records only? Defaults to True.

Returns:

creations None: if no match is found

Return type:

list

classmethod search_by_artistname_and_title(artist_name, title, active=True)[source]

Searches creations by artist name and title

Parameters:
  • artist_name (char) – artist.name

  • title (char) – creation.title

  • active (bool, optional) – active records only? Defaults to True.

Returns:

creations None: if no match is found

Return type:

list

classmethod search_by_code(creation_code, active=True)[source]

Searches a creation by artist code

Parameters:

creation_code (int) – creation.code

Returns:

creation None: if no match is found

Return type:

obj

classmethod search_by_contributions_of_artist(artist_id, active=True)[source]

Searches creations by contributions of artist id

Parameters:
  • artist_id (int) – artist.id

  • active (bool, optional) – active records only? Defaults to True.

Returns:

creations None: if no match is found

Return type:

list

classmethod search_by_id(creation_id, active=True)[source]

Searches a creation by creation id

Note

We don’t want our internal ids to be exposed to the world. So better use search_by_oid().

Parameters:
  • creation_id (int) – creation.id

  • active (bool, optional) – active records only? Defaults to True.

Returns:

creation None: if no match is found

Return type:

obj

classmethod search_by_oid(oid, active=True)[source]

Searches a creation by oid (public api id)

Parameters:

oid (uuid) – creation.oid

Returns:

creation None: if no match is found

Return type:

obj

classmethod search_by_party(party_id, active=True)[source]

Searches creations by party id

Parameters:
  • party_id (int) – party.party.id

  • active (bool, optional) – active records only? Defaults to True.

Returns:

creations of web_user None: if no match is found

Return type:

list

classmethod search_count(domain, escape=False, active=True)[source]

Counts creations by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

number of creations

Return type:

int

classmethod search_viewable_by_web_user(web_user_id, active=True)[source]

Searches creations, which the web_user is allowed to view.

Parameters:

web_user_id (int) – web.user.id

Returns:

viewable creations of web_user, empty if none were found

Return type:

list

collecting_society_web.models.creation_contribution module

class collecting_society_web.models.creation_contribution.CreationContribution[source]

Bases: Tdb

Model wrapper for Tryton model object ‘creation.contribution’

classmethod create(vlist)[source]

Creates creation contributions

Parameters:

vlist (list) – list of dicts with attributes to create

Raises:

KeyError – if required field is missing

Returns:

created creation contributions None: if no object was created

Return type:

list

classmethod delete(contributions)[source]

Deletes creation contribution

Parameters:

contributions (list) – creation.contribution

Returns:

?

classmethod search_all()[source]

Fetches all creation contributions

Returns:

creation.contribution None: if no match is found

Return type:

list

classmethod search_by_id(contribution_id)[source]

Searches a creation contribution by id

Parameters:

contribution_id (int) – contribution.id

Returns:

creation.contribution None: if no match is found

Return type:

obj

classmethod search_by_oid(oid)[source]

Searches a creation contribution by oid (public api id)

Parameters:

oid (int) – creation.contribution.oid

Returns:

creation.contribution None: if no match is found

Return type:

obj

collecting_society_web.models.creation_derivative module

class collecting_society_web.models.creation_derivative.CreationDerivative[source]

Bases: Tdb

Model wrapper for Tryton model object ‘creation_derivative’

classmethod create(vlist)[source]

Creates origina-derivative relations

Parameters:
  • vlist (list) – list of dicts with attributes

  • relations:: (to create origina-derivative) –

    [
    {

    ‘original_creation’: creation.id, ‘derivative_creation’: creation.id, ‘allocation_type’: ‘adaption’|’cover’|’remix’

    }, {

    }

    ]

Raises:

KeyError – if required field is missing

Returns:

created origina-derivative relations None: if no object was created

Return type:

list

classmethod delete(creation)[source]

Deletes creation(s)

Parameters:

creation (list) –

creations:

[creation1, creation2, ...]

Returns:

?

classmethod search_by_oid(oid)[source]

Searches for a CreationDerivative object by its oid

Parameters:

oid (string) – a uuid formed string

Returns:

CreationDerivative object None: if no match is found

Return type:

obj

classmethod search_original_derivative_pair(derivative_oid, original_oid)[source]

Searches for certain derivative/original combinations

Parameters:
  • derivative_oid (string)

  • original_oid (string) – a uuid formed string

Returns:

list of creations None: if no match is found

Return type:

obj

classmethod search_originals_of_creation_by_id(creation_id)[source]

Searches all original creations of a creation by its id

Parameters:

creation_id (int) – creation.id

Returns:

list of creations None: if no match is found

Return type:

obj

collecting_society_web.models.creation_identifier module

class collecting_society_web.models.creation_identifier.CreationIdentifier[source]

Bases: Tdb

Model wrapper for Tryton model object ‘creation_identifier’

classmethod search_all()[source]

Fetches all CreationIdentifiers

Returns:

creation_identifiers None: if no match is found

Return type:

list

classmethod search_by_code(id_code)[source]

Searches all foreign creation_identifiers for a given native id_code

Note

This is the preferred method of accessing an identifier. Only if id_space and id_code are both provided, an object can be determined with certainty.

Parameters:

id_code (string) – creation_identifier.id_code

Returns:

creation_identifier list None: if no match is found

Return type:

obj

classmethod search_by_id(id)[source]

Searches a creation_identifier by id

Parameters:

id (int) – creation_identifier.id

Note

This is a search for the internal database id, not the id_code of a certaion id_space.

Returns:

creation_identifier None: if no match is found

Return type:

obj

classmethod search_by_spacecode(id_space, id_code)[source]

Searches a creation_identifier in certain id_space by given id_code

Note

This is the preferred method of accessing an identifier. Only if id_space and id_code are bothe provided, an object can be determined with certainty.

Parameters:
  • id_code (string) – creation_identifier.id_code

  • id_space (string) – creation_identifier.id_space

Returns:

creation_identifier None: if no match is found

Return type:

obj

collecting_society_web.models.creation_identifier_space module

class collecting_society_web.models.creation_identifier_space.CreationIdentifierSpace[source]

Bases: Tdb

Model wrapper for Tryton model object ‘creation_identifier_space’

classmethod search_all()[source]

Fetches all CreationIdentifierSpaces

Returns:

creation_identifier_spaces None: if no match is found

Return type:

list

classmethod search_by_id(id)[source]

Searches a creation_identifier_space by id

Parameters:

id (int) – creation_identifier_space.id

Returns:

creation_identifier_space None: if no match is found

Return type:

obj

classmethod search_by_name(name)[source]

Searches a creation_identifier_space by name

Parameters:

name (string) – creation_identifier_space.name

Returns:

creation_identifier_space None: if no match is found

Return type:

obj

collecting_society_web.models.creation_right module

class collecting_society_web.models.creation_right.CreationRight[source]

Bases: Tdb

Model wrapper for Tryton model object ‘creation.right’

classmethod create(vlist)[source]

Creates creation.right relations

Parameters:
  • vlist (list) – list of dicts with attributes

  • relations:: (to create creation.right) –

    [
    {

    ‘rightsholder’: right_subject.id, ‘rightsobject’: creation.id, ‘type_of_right’: “copyright”, ‘contribution’: “production”, ‘instruments’: instruments_dict,

    }, {

    }

    ]

Raises:

KeyError – if required field is missing

Returns:

created creation.right relations None: if no object was created

Return type:

list

classmethod delete(cr)[source]

Deletes creation.right relations

Parameters:

cr (list) –

creation.right relations:

[creation right 1, creation.right 2, ...]

Returns:

?

classmethod get_contributions_by_type_of_right(t_o_r)[source]
classmethod search(domain, offset=None, limit=None, order=None, escape=False)[source]

Searches creation rights by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

list of creation rights

Return type:

obj

classmethod search_count(domain, escape=False, active=True)[source]

Counts creation rights by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

number of creation rights

Return type:

int

collecting_society_web.models.creation_right_instrument module

class collecting_society_web.models.creation_right_instrument.CreationRightInstrument[source]

Bases: Tdb

Model wrapper for Tryton model object ‘creation.right’

classmethod search_by_right_and_instrument(right_id, instrument_id)[source]

Searches creation.right-instrument

Parameters:
  • right_id (int) – creation-right.id

  • instrument_id (int) – instrument.id

Returns:

creations.right None: if no match is found

Return type:

list

collecting_society_web.models.creation_role module

class collecting_society_web.models.creation_role.CreationRole[source]

Bases: Tdb

Model wrapper for Tryton model object ‘creation.role’

classmethod search_all()[source]

Fetches all creation roles

Returns:

creation roles None: if no match is found

Return type:

list

classmethod search_by_id(id)[source]

Searches a creation role by id

Parameters:

id (int) – creation.role.id

Returns:

creation role None: if no match is found

Return type:

obj

classmethod search_by_name(name)[source]

Searches a creation role by name

Parameters:

name (string) – creation.role

Returns:

creation role None: if no match is found

Return type:

obj

classmethod search_by_oid(oid)[source]

Searches an creation role by oid (public api id)

Parameters:

oid (int) – creation.role.oid

Returns:

creation role None: if no match is found

Return type:

obj

collecting_society_web.models.creation_tariff_category module

class collecting_society_web.models.creation_tariff_category.CreationTariffCategory[source]

Bases: Tdb

Model wrapper for Tryton model object ‘creation-tariff_category’

classmethod create(vlist)[source]

Creates creation tariff categories

Parameters:

vlist (list) – list of dicts with attributes to create objects

Raises:

KeyError – if required field is missing

Returns:

created creation tariff categories None: if no object was created

Return type:

list

classmethod delete(ctcs)[source]

Deletes creation tariff categories

Parameters:

ctcs (list) –

creation tariff categories:

[creation_tariff_category, creation_tariff_category, ...]

Returns:

?

classmethod search(domain, offset=None, limit=None, order=None, escape=False)[source]

Searches creation tariff categories by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

list of creation tariff categories

Return type:

obj

classmethod search_all()[source]

Fetches all creation tariff categories

Returns:

creation tariff categories None: if no match is found

Return type:

list

classmethod search_by_id(ctc_id)[source]

Searches a creation tariff category by creation tariff category id

Parameters:

ctc_id (int) – creation_tariff_category.id

Returns:

creation tariff category None: if no match is found

Return type:

obj

classmethod search_by_oid(oid)[source]

Searches a creation tariff category by oid (public api id)

Parameters:

oid (int) – creation_tariff_category.oid

Returns:

creation tariff category None: if no match is found

Return type:

obj

collecting_society_web.models.declaration module

class collecting_society_web.models.declaration.Declaration[source]

Bases: Tdb, MixinSearchById

Model wrapper for Tryton model object ‘declaration’

classmethod belongs_to_current_licensee(request)[source]

returns all objects that belong to a certain licensee

Parameters:

request (pyramid.request.Request) – Current request.

Returns:

objects that belong to the licensee None: if no match is found

Return type:

list

collecting_society_web.models.declaration_group module

class collecting_society_web.models.declaration_group.DeclarationGroup[source]

Bases: Tdb, MixinSearchById, MixinSearchByName

Model wrapper for Tryton model object ‘declaration.group’

collecting_society_web.models.device module

class collecting_society_web.models.device.Device[source]

Bases: Tdb

Model wrapper for Tryton model object ‘device’

classmethod belongs_to_current_webuser(request)[source]

returns all objects that belong to a certain licensee

Parameters:

request (pyramid.request.Request) – Current request.

Returns:

objects that belong to the licensee None: if no match is found

Return type:

list

classmethod create(vlist)[source]

Creates devices

Parameters:

vlist (list) –

list of dicts with attributes to create devices:

[
    {
        'web_user': ...,
        'uuid': ...,
        'name': ...,
        'os_name': ...,
        'os_version': ...,
        'software_name': ...,
        'software_version': ...,
        'software_vendor': ...
    },
    {
        ...
    }
]

Raises:

KeyError – if required field is missing

Returns:

created devices None: if no object was created

Return type:

list

classmethod delete(device)[source]

Deletes device

Parameters:

device (list) –

devices:

[device1, device2, ...]

Returns:

?

classmethod search(domain, offset=None, limit=None, order=None, escape=False, active=True)[source]

Searches devices by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

list of devices

Return type:

obj

classmethod search_all(active=True)[source]

Fetches all Devices

Returns:

device None: if no match is found

Return type:

list

classmethod search_by_id(device_id, active=True)[source]

Searches an device by device id

Parameters:

device_id (int) – device.id

Returns:

device None: if no match is found

Return type:

obj

classmethod search_by_name(device_name, active=True)[source]

Searches devices by device name

Parameters:

device_name (str) – device.name

Returns:

list of devices

Return type:

obj

classmethod search_by_uuid(device_uuid, active=True)[source]

Searches an device by device uuid

Parameters:

device_uuid (string) – device.uuid

Returns:

device None: if no match is found

Return type:

obj

classmethod search_count(domain, escape=False, active=True)[source]

Counts devices by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

number of devices

Return type:

int

collecting_society_web.models.device_message module

class collecting_society_web.models.device_message.DeviceMessage[source]

Bases: Tdb, MixinSearchById, MixinSearchByUuid

Model wrapper for Tryton model object ‘device.message’

collecting_society_web.models.device_message_fingerprint_creationlist module

class collecting_society_web.models.device_message_fingerprint_creationlist.DeviceMessageFingerprintCreationlist[source]

Bases: Tdb, MixinSearchById

Model wrapper for Tryton model object ‘device.message.fingerprint.creationlist’

collecting_society_web.models.event module

class collecting_society_web.models.event.Event[source]

Bases: Tdb, MixinSearchById

Model wrapper for Tryton model object ‘event’

collecting_society_web.models.event_performance module

class collecting_society_web.models.event_performance.EventPerformance[source]

Bases: Tdb, MixinSearchById

Model wrapper for Tryton model object ‘event.performance’

collecting_society_web.models.genre module

class collecting_society_web.models.genre.Genre[source]

Bases: Tdb

Model wrapper for Tryton model object ‘genre’

classmethod search_all()[source]

Fetches all Genres

Returns:

genres None: if no match is found

Return type:

list

classmethod search_by_id(id)[source]

Searches a genre by id

Parameters:

id (int) – genre.id

Returns:

genre None: if no match is found

Return type:

obj

classmethod search_by_name(name)[source]

Searches a genre by name

Parameters:

name (string) – genre.name

Returns:

genre None: if no match is found

Return type:

obj

classmethod search_by_oid(oid, active=True)[source]

Searches an genre by oid (public api id)

Parameters:

oid (int) – genre.oid

Returns:

genre None: if no match is found

Return type:

obj

collecting_society_web.models.instrument module

class collecting_society_web.models.instrument.Instrument[source]

Bases: Tdb, MixinSearchById, MixinSearchByOid, MixinSearchAll

Model wrapper for Tryton model object ‘instrument’

collecting_society_web.models.label module

class collecting_society_web.models.label.Label[source]

Bases: Tdb

Model wrapper for Tryton model object ‘label’

classmethod create(vlist)[source]

Creates labels

Parameters:

vlist (list) –

list of dicts with attributes to create label:

[
    {
        'name': str (required)
    },
    {
        ...
    }
]

Raises:

KeyError – if required field is missing

Returns:

created labels None: if no object was created

Return type:

list

classmethod search(domain, offset=None, limit=None, order=None, escape=False)[source]

Searches labels by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

list of labels

Return type:

obj

classmethod search_all()[source]

Fetches all Labels

Returns:

labels None: if no match is found

Return type:

list

classmethod search_by_gvl_code(gvl_code)[source]

Searches a label by gvl code

Parameters:

gvl_code (string) – label.gvl_code

Returns:

label None: if no match is found

Return type:

obj

classmethod search_by_name_starting_with(name_starting_with)[source]

Searches a label for a name starting with certaion characters

Parameters:

name_starting_with (string) – label.name

Returns:

label None: if no match is found

Return type:

obj

classmethod search_by_oid(oid, active=True)[source]

Searches a label by oid (public api id)

Parameters:

oid (int) – label.oid

Returns:

label None: if no match is found

Return type:

obj

classmethod search_count(domain, escape=False, active=True)[source]

Counts labels by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

number of labels

Return type:

int

collecting_society_web.models.license module

class collecting_society_web.models.license.License[source]

Bases: Tdb

Model wrapper for Tryton model object ‘license’

classmethod search_all()[source]

Fetches all Licenses

Returns:

licenses None: if no match is found

Return type:

list

classmethod search_by_id(license_id)[source]

Searches an license by license id

Parameters:

license_id (int) – license.id

Returns:

license None: if no match is found

Return type:

obj

classmethod search_by_oid(oid, active=True)[source]

Searches a license by oid (public api id)

Parameters:

oid (int) – license.oid

Returns:

license None: if no match is found

Return type:

obj

collecting_society_web.models.location module

class collecting_society_web.models.location.Location[source]

Bases: Tdb, MixinSearchById, MixinSearchByOid, MixinSearchAll

Model wrapper for Tryton model object ‘location’

classmethod create(vlist)[source]

Creates location

Parameters:

vlist (list) –

list of dicts with attributes to create publisher:

[
    {
        'name': str (required)
        'entity_creator': int (required)
    },
    {
        ...
    }
]

Raises:

KeyError – if required field is missing

Returns:

created location None: if no object was created

Return type:

list

classmethod delete(location)[source]

Deletes location

Parameters:

location (list) –

locations:

[location1, location2, ...]

Returns:

?

classmethod search_by_entity_creator(party_id, active=True)[source]

Searches locations, the web_user is allowed to view.

Parameters:

web_user_id (int) – web.user.id

Returns:

viewable creations of web_user, empty if none were found

Return type:

list

collecting_society_web.models.location_category module

class collecting_society_web.models.location_category.LocationCategory[source]

Bases: Tdb, MixinSearchById, MixinSearchByCode, MixinSearchByName, MixinSearchAll

Model wrapper for Tryton model object ‘location.category’

collecting_society_web.models.location_indicators_period module

class collecting_society_web.models.location_indicators_period.LocationIndicatorsPeriod[source]

Bases: Tdb, MixinSearchById

Model wrapper for Tryton model object ‘location.indicators.period’

collecting_society_web.models.location_space module

class collecting_society_web.models.location_space.LocationSpace[source]

Bases: Tdb, MixinSearchById, MixinSearchByOid, MixinSearchAll

Model wrapper for Tryton model object ‘location.space’

classmethod search_count(domain, escape=False, active=True)[source]

Counts location spaces by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

number of location spaces

Return type:

int

collecting_society_web.models.location_space_category module

class collecting_society_web.models.location_space_category.LocationSpaceCategory[source]

Bases: Tdb, MixinSearchById, MixinSearchByCode, MixinSearchByName, MixinSearchAll

Model wrapper for Tryton model object ‘location.space.category’

collecting_society_web.models.publisher module

class collecting_society_web.models.publisher.Publisher[source]

Bases: Tdb

Model wrapper for Tryton model object ‘publisher’

classmethod create(vlist)[source]

Creates publisher

Parameters:

vlist (list) –

list of dicts with attributes to create publisher:

[
    {
        'name': str (required)
    },
    {
        ...
    }
]

Raises:

KeyError – if required field is missing

Returns:

created publisher None: if no object was created

Return type:

list

classmethod search(domain, offset=None, limit=None, order=None, escape=False)[source]

Searches publisher by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

list of publisher

Return type:

obj

classmethod search_all()[source]

Fetches all Labels

Returns:

publisher None: if no match is found

Return type:

list

classmethod search_by_oid(oid, active=True)[source]

Searches a label by oid (public api id)

Parameters:

oid (int) – label.oid

Returns:

label None: if no match is found

Return type:

obj

classmethod search_count(domain, escape=False, active=True)[source]

Counts publisher by domain

Parameters:

domain (list) – domain passed to tryton

Returns:

number of publisher

Return type:

int

collecting_society_web.models.release module

class collecting_society_web.models.release.Release[source]

Bases: Tdb

Model wrapper for Tryton model object ‘release’

classmethod create(vlist)[source]

Creates Releases

Parameters:

vlist (list) –

list of dicts with attributes to create releases:

[
    {
        ...2DO
    },
    {
        ...
    }
]

Raises:

KeyError – if required field is missing

Returns:

created releases None: if no object was created

Return type:

list

classmethod current_editable(request)[source]

Searches releases, which the current web user is allowed to edit.

Parameters:

request (pyramid.request.Request) – Current request.

Returns:

editable releases of current web_user None: if no match is found

Return type:

list

classmethod current_viewable(request)[source]

Searches releases, which the current web user is allowed to view.

Parameters:

request (pyramid.request.Request) – Current request.

Returns:

viewable releases of current web_user None: if no match is found

Return type:

list

classmethod delete(release)[source]

Deletes release

Parameters:

release (list) –

realeases:

[release1, release2, ...]

Returns:

?

classmethod search_all(active=True)[source]

Fetches all Releases

Parameters:

active (bool, optional) – active records only? Defaults to True.

Returns:

releases None: if no match is found

Return type:

list

classmethod search_by_code(release_code, active=True)[source]

Searches an release by release code

Parameters:

release_code (string) – release.code

Returns:

release None: if no match is found

Return type:

obj

classmethod search_by_id(uid, active=True)[source]

Searches releases by id

Note

We don’t want our internal ids to be exposed to the world. So better use search_by_oid().

Parameters:

uid (int) – release id

Returns:

releases of web_user None: if no match is found

Return type:

list

classmethod search_by_oid(oid, active=True)[source]

Searches a release by oid (public api id)

Parameters:

oid (int) – release.oid

Returns:

release None: if no match is found

Return type:

obj

classmethod search_by_party(party_id, active=True)[source]

Searches releases by party id

Parameters:

party_id (int) – party.party.id

Returns:

releases of web_user

and of releases the web user has creations on

None: if no match is found

Return type:

list

classmethod search_editable_by_web_user(web_user_id, active=True)[source]

Searches releases, which the web_user is allowed to edit.

Parameters:

web_user_id (int) – web.user.id

Returns:

editable releases of web_user, empty if none were found

Return type:

list

classmethod search_viewable_by_web_user(web_user_id, active=True)[source]

Searches releases, which the web_user is allowed to view.

Parameters:

web_user_id (int) – web.user.id

Returns:

viewable releases of web_user, empty if none were found

Return type:

list

collecting_society_web.models.release_identifier module

class collecting_society_web.models.release_identifier.ReleaseIdentifier[source]

Bases: Tdb

Model wrapper for Tryton model object ‘release_identifier’

classmethod search_all()[source]

Fetches all ReleaseIdentifiers

Returns:

release_identifiers None: if no match is found

Return type:

list

classmethod search_by_code(id_code)[source]

Searches all foreign release_identifiers for a given native id_code

Note

This is the preferred method of accessing an identifier. Only if id_space and id_code are both provided, an object can be determined with certainty.

Parameters:

id_code (string) – release_identifier.id_code

Returns:

release_identifier list None: if no match is found

Return type:

obj

classmethod search_by_id(id)[source]

Searches a release_identifier by id

Parameters:

id (int) – release_identifier.id

Note

This is a search for the internal database id, not the id_code of a certaion id_space.

Returns:

release_identifier None: if no match is found

Return type:

obj

classmethod search_by_spacecode(id_space, id_code)[source]

Searches a release_identifier in certain id_space by given id_code

Note

This is the preferred method of accessing an identifier. Only if id_space and id_code are bothe provided, an object can be determined with certainty.

Parameters:
  • id_code (string) – release_identifier.id_code

  • id_space (string) – release_identifier.id_space

Returns:

release_identifier None: if no match is found

Return type:

obj

collecting_society_web.models.release_identifier_space module

class collecting_society_web.models.release_identifier_space.ReleaseIdentifierSpace[source]

Bases: Tdb

Model wrapper for Tryton model object ‘release_identifier_space’

classmethod search_all()[source]

Fetches all ReleaseIdentifierSpaces

Returns:

release_identifier_spaces None: if no match is found

Return type:

list

classmethod search_by_id(id)[source]

Searches a release_identifier_space by id

Parameters:

id (int) – release_identifier_space.id

Returns:

release_identifier_space None: if no match is found

Return type:

obj

classmethod search_by_name(name)[source]

Searches a release_identifier_space by name

Parameters:

name (string) – release_identifier_space.name

Returns:

release_identifier_space None: if no match is found

Return type:

obj

collecting_society_web.models.style module

class collecting_society_web.models.style.Style[source]

Bases: Tdb

Model wrapper for Tryton model object ‘style’

classmethod search_all()[source]

Fetches all Styles

Returns:

styles None: if no match is found

Return type:

list

classmethod search_by_id(id)[source]

Searches a style by id

Parameters:

id (int) – style.id

Returns:

style None: if no match is found

Return type:

obj

classmethod search_by_name(name)[source]

Searches a style by name

Parameters:

name (string) – style.name

Returns:

style None: if no match is found

Return type:

obj

classmethod search_by_oid(oid, active=True)[source]

Searches a style by oid (public api id)

Parameters:

oid (int) – style.oid

Returns:

style None: if no match is found

Return type:

obj

collecting_society_web.models.tariff_category module

class collecting_society_web.models.tariff_category.TariffCategory[source]

Bases: Tdb

Model wrapper for Tryton model object ‘tariff_system.category’

classmethod search_all()[source]

Fetches all tariff categories

Returns:

tariff categories None: if no match is found

Return type:

list

classmethod search_by_id(category_id)[source]

Searches a tariff category by id

Parameters:

category_id (int) – tariff_category.id

Returns:

tariff category None: if no match is found

Return type:

obj

classmethod search_by_oid(oid, active=True)[source]

Searches a tariff category by oid (public api id)

Parameters:

oid (int) – tariff_category.oid

Returns:

tariff category None: if no match is found

Return type:

obj

collecting_society_web.models.track module

class collecting_society_web.models.track.Track[source]

Bases: Tdb

Model wrapper for Tryton model object ‘artist’

classmethod create(vlist)[source]

Creates tracks

Parameters:

vlist (list) – list of dicts with attributes to create tracks

Raises:

KeyError – if required field is missing

Returns:

created tracks None: if no object was created

Return type:

list

classmethod delete(tracks)[source]

Deletes track

Parameters:

tracks (list) –

tracks:

[artist1, artist2, ...]

Returns:

?

classmethod search_all()[source]

Fetches all Tracks

Returns:

tracks None: if no match is found

Return type:

list

classmethod search_by_id(track_id)[source]

Searches a track by track id

Parameters:

track_id (int) – track.id

Returns:

track None: if no match is found

Return type:

obj

classmethod search_by_oid(oid)[source]

Searches a track by oid (public api id)

Parameters:

oid (int) – track.oid

Returns:

track None: if no match is found

Return type:

obj

collecting_society_web.models.utilisation module

class collecting_society_web.models.utilisation.Utilisation[source]

Bases: Tdb, MixinSearchById

Model wrapper for Tryton model object ‘utilisation’

collecting_society_web.models.website module

class collecting_society_web.models.website.Website[source]

Bases: Tdb, MixinSearchById

Model wrapper for Tryton model object ‘website’

collecting_society_web.models.website_resource module

class collecting_society_web.models.website_resource.WebsiteResource[source]

Bases: Tdb, MixinSearchById, MixinSearchByName, MixinSearchByUuid

Model wrapper for Tryton model object ‘website.resource’

collecting_society_web.models.website_resource_category module

class collecting_society_web.models.website_resource_category.WebsiteResourceCategory[source]

Bases: Tdb, MixinSearchById, MixinSearchByName, MixinSearchByCode

Model wrapper for Tryton model object ‘website.resource.category’

Module contents