Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/concepts/custom_field_query.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The `custom_field_query` filter lets you search documents by custom field values
| ------------------------------------ | ----------------- | ---------------------- |
| `CustomFieldQuery(field, op, value)` | — | `[field, op, value]` |
| `CustomFieldQueryAnd(q1, q2, …)` | `q1 & q2` | `["AND", [q1, q2, …]]` |
| `CustomFieldQueryOr(q1, q2, …)` | `q1 \| q2` | `["OR", [q1, q2, …]]` |
| `CustomFieldQueryOr(q1, q2, …)` | `q1 | q2` | `["OR", [q1, q2, …]]` |
| `CustomFieldQueryNot(q)` | `~q` | `["NOT", q]` |

Import from `pypaperless.models.custom_field_query` (or via `pypaperless.models.types`):
Expand Down
24 changes: 12 additions & 12 deletions docs/concepts/custom_fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Each custom field has a `data_type` which determines the type of its value:
| `INTEGER` | `int` | Integer number |
| `FLOAT` | `float` | Floating point number |
| `MONETARY` | `str` | Currency amount, e.g. `"EUR12.50"` |
| `SELECT` | `int | Selection from predefined options |
| `SELECT` | `int | str` | Selection from predefined options |
| `DOCUMENT_LINK` | `list[int]` | Links to other documents by ID |

---
Expand Down Expand Up @@ -115,17 +115,17 @@ A `TypeError` is raised if the actual type does not match `expected_type`.

When the cache is active, pypaperless instantiates the right subclass automatically:

| Class | `data_type` | `value` type |
| ------------------------------ | -------------------- | ----------------------- |
| `CustomFieldStringValue` | `STRING`, `LONGTEXT` | `str |
| `CustomFieldURLValue` | `URL` | `str |
| `CustomFieldDateValue` | `DATE` | `datetime.date |
| `CustomFieldBooleanValue` | `BOOLEAN` | `bool |
| `CustomFieldIntegerValue` | `INTEGER` | `int |
| `CustomFieldFloatValue` | `FLOAT` | `float |
| `CustomFieldMonetaryValue` | `MONETARY` | `str |
| `CustomFieldSelectValue` | `SELECT` | `int | str |
| `CustomFieldDocumentLinkValue` | `DOCUMENT_LINK` | `list[int] |
| Class | `data_type` | `value` type |
| ------------------------------ | -------------------- | ---------------- |
| `CustomFieldStringValue` | `STRING`, `LONGTEXT` | `str` |
| `CustomFieldURLValue` | `URL` | `str` |
| `CustomFieldDateValue` | `DATE` | `datetime.date` |
| `CustomFieldBooleanValue` | `BOOLEAN` | `bool` |
| `CustomFieldIntegerValue` | `INTEGER` | `int` |
| `CustomFieldFloatValue` | `FLOAT` | `float` |
| `CustomFieldMonetaryValue` | `MONETARY` | `str` |
| `CustomFieldSelectValue` | `SELECT` | `int | str` |
| `CustomFieldDocumentLinkValue` | `DOCUMENT_LINK` | `list[int]` |

### `CustomFieldMonetaryValue` extras

Expand Down
23 changes: 20 additions & 3 deletions docs/concepts/documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ if document.has_search_hit:
hit = document.search_hit
print(hit.score)
print(hit.highlights)
print(hit.note_highlights)
print(hit.rank)
```

Expand Down Expand Up @@ -149,6 +150,7 @@ print(suggestions.correspondents) # list[int]
print(suggestions.document_types) # list[int]
print(suggestions.tags) # list[int]
print(suggestions.storage_paths) # list[int]
print(suggestions.dates) # list[datetime.date]
```

---
Expand Down Expand Up @@ -242,9 +244,9 @@ print(f"Upload queued as task: {task_id}")
| `correspondent` | Correspondent ID |
| `document_type` | Document type ID |
| `storage_path` | Storage path ID |
| `tags` | list[int] | Tag ID(s) |
| `archive_serial_number` | ASN |
| `custom_fields` | DocumentCustomFieldList | Custom field assignments |
| `tags` | Tag IDs |
| `archive_serial_number` | Archive serial number |
| `custom_fields` | Custom field assignments |

### Uploading with custom fields

Expand Down Expand Up @@ -295,6 +297,21 @@ print(task.status, task.result)

---

## Checking if a document is deleted

The `is_deleted` property returns `True` when the document is currently in the trash:

```python
doc = await paperless.documents(42)
print(doc.is_deleted) # False for active documents

# Documents returned from paperless.trash also have this set
async for doc in paperless.trash:
print(doc.id, doc.is_deleted, doc.deleted_at)
```

---

## Sending documents by e-mail

You can send one or more documents as attachments to one or more e-mail addresses:
Expand Down
12 changes: 6 additions & 6 deletions docs/concepts/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ class Permissions:

Constructed with flat keyword arguments — only specify what you need, omitted keys default to `[]`:

| Keyword argument | Type | Meaning |
| ---------------- | ----------- | -------------------------------- |
| `view_users` | `list[int]` | User IDs with view permission |
| `view_groups` | `list[int]` | Group IDs with view permission |
| `change_users` | `list[int]` | User IDs with change permission |
| `change_groups` | `list[int]` | Group IDs with change permission |
| Keyword argument | Meaning |
| ---------------- | -------------------------------- |
| `view_users` | User IDs with view permission |
| `view_groups` | Group IDs with view permission |
| `change_users` | User IDs with change permission |
| `change_groups` | Group IDs with change permission |

```python
from pypaperless.models.types import Permissions
Expand Down
Loading