-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
increase timeout for http requests; add join logic to query
- Loading branch information
Showing
14 changed files
with
101 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ older than 3.11 and want to use `pyproject.toml` configuration, install with | |
## Configuration | ||
|
||
Configure your credentials in environment variables, a `.civipy` file, or in | ||
`pyproject.toml` in a `tools.civipy` section. By default CiviPy will read a `.civipy` | ||
`pyproject.toml` in a `tools.civipy` section. By default, CiviPy will read a `.civipy` | ||
file anywhere in the current working directory up to your project root, or your | ||
project's `pyproject.toml` file, or a `.civipy` file in the user's home folder. | ||
Settings in environment variables will overwrite any file settings. Alternatively, | ||
|
@@ -44,15 +44,16 @@ You can specify in an environment variable either a directory to find a `.civipy | |
configuration file in, or a file to read as a `.civipy` configuration file. | ||
|
||
## Usage | ||
There are class methods for retrieving and creating records and instance methods | ||
for working with them. | ||
There is a Django-style `.objects` attribute on each record model with `filter`, `values`, | ||
`order_by`, and `all` methods for querying; and `create`, `delete`, and `update` methods | ||
for making changes. Model instances also have `save` and `delete` methods. | ||
|
||
```python | ||
from civipy import CiviContact, CiviEmail | ||
from civipy import CiviContact | ||
|
||
contact = CiviContact.find_by_email("[email protected]") | ||
email = CiviEmail.find_or_create(where={"contact_id": contact.id, "email": "[email protected]"}) | ||
contact.update(nick_name="Ana") | ||
contact = CiviContact.objects.filter(email_primary__email="[email protected]")[0] | ||
contact.nick_name = "Ana" | ||
contact.save() | ||
``` | ||
|
||
Each CiviCRM Entity is represented by a subclass of CiviCRMBase; if you need an entity | ||
|
@@ -66,9 +67,6 @@ class CiviNewEntity(civipy.CiviCRMBase): | |
pass | ||
``` | ||
|
||
Many CiviCRM Actions have a corresponding method (e.g. `get`, `create`), and there are | ||
also a number of convenience methods which do more processing (e.g. `find_or_create`). | ||
|
||
## Copyright & License | ||
civipy Copyright © 2020 Ana Nelson | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.