ads.Library¶
- class ads.Library(*args, **kwargs)[source]¶
A data model for a library managed by ADS.
- __init__(*args, **kwargs)¶
Methods
__init__
(*args, **kwargs)add_index
(*fields, **kwargs)alias
([alias])bind
(database[, bind_refs, bind_backrefs, ...])bind_ctx
(database[, bind_refs, bind_backrefs])bulk_create
(model_list[, batch_size])bulk_update
(model_list, fields[, batch_size])clone
()coerce
([_coerce])copy
(library)Copy the bibcode contents from the this library to the given library.
create
(**query)create_table
([safe])delete
()Delete this library from ADS.
delete_by_id
(pk)delete_instance
([recursive, delete_nullable])dependencies
([search_nullable])difference
(library)Take the difference of two libraries.
drop_table
([safe, drop_sequences])empty
()Empty a library of all its documents.
filter
(*dq_nodes, **filters)get
(*query, **filters)get_by_id
(pk)get_id
()get_or_create
(**kwargs)get_or_none
(*query, **filters)index
(*fields, **kwargs)insert
([_Model__data])insert_from
(query, fields)insert_many
(rows[, fields])intersection
(library)Take the intersection of this library with another.
is_alias
()is_dirty
()noop
()raw
(sql, *params)replace
([_Model__data])replace_many
(rows[, fields])save
([force_insert, only])select
(*fields)set_by_id
(key, value)table_exists
()truncate_table
(**options)union
(*libraries)Return a new library that is the union of this library and the others.
unwrap
()update
([_Model__data])validate_model
()Attributes
children
Date (UTC) the library was created.
Date (UTC) the library was last modified.
Description of the library.
dirty_fields
The documents in this library.
documents_id
Unique identifier for this library, which is assigned by ADS.
Given name to the library.
Number of documents in the library.
Number of users of the library.
The ADS username of the owner of the library.
Permissions for the library.
permissions_id
Whether the library is public.
- id = <TextField: Library.id>¶
Unique identifier for this library, which is assigned by ADS.
- num_users = <IntegerField: Library.num_users>¶
Number of users of the library.
- num_documents = <IntegerField: Library.num_documents>¶
Number of documents in the library.
- date_created = <DateTimeField: Library.date_created>¶
Date (UTC) the library was created.
- date_last_modified = <DateTimeField: Library.date_last_modified>¶
Date (UTC) the library was last modified.
- name = <TextField: Library.name>¶
Given name to the library.
- description = <TextField: Library.description>¶
Description of the library.
- public = <BooleanField: Library.public>¶
Whether the library is public.
- owner = <TextField: Library.owner>¶
The ADS username of the owner of the library.
- documents = <DocumentArrayField: Library.documents>¶
The documents in this library.
- permissions = <PermissionsField: Library.permissions>¶
Permissions for the library.
- union(*libraries)[source]¶
Return a new library that is the union of this library and the others.
- Parameters
libraries – An iterable of libraries to union with this library.
- Returns
A new library that is the union of this library and the others.
- intersection(library)[source]¶
Take the intersection of this library with another.
- Parameters
libraries – A list of libraries to take the intersection with this library.
- Returns
A new library that is the intersection of this library and the other.
- difference(library)[source]¶
Take the difference of two libraries.
- Parameters
library – The library to take the difference with.
- Returns
A new library that is the difference of this library and the other.
- copy(library)[source]¶
Copy the bibcode contents from the this library to the given library.
This will not empty the first library.
- Parameters
library – The library to copy to.
- Returns
A boolean.
- DoesNotExist¶
alias of
ads.models.library.LibraryDoesNotExist