Models Documentation¶
- class lims_app.models.Book(*args, **kwargs)[source]¶
Represents a book in the library system.
- name¶
The name of the book.
- Type:
str
- isbn¶
The ISBN number of the book.
- Type:
int
- author¶
The author of the book.
- Type:
str
- category¶
The category of the book, default is ‘education’.
- Type:
str
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- author¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- category¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- isbn¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- readers¶
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppingsandTopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
- class lims_app.models.Reader(*args, **kwargs)[source]¶
Represents a library reader.
- reference_id¶
A unique reference identifier for the reader.
- Type:
int
- reader_name¶
The name of the reader.
- Type:
str
- reader_contact¶
The contact information for the reader.
- Type:
str
- reader_address¶
The address of the reader.
- Type:
str
- active¶
A flag indicating whether the reader is active.
- Type:
bool
- books¶
A many-to-many relationship with Book, indicating which books the reader has.
- Type:
ManyToManyField
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- active¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- books¶
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppingsandTopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- reader_address¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- reader_contact¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- reader_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- reference_id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.