a Salesforce backend for Django's ORM
Project description
Salesforce backend for Django’s ORM.
Quick Start
Install django-salesforce: pip install django-salesforce
Add the salesforce app to your INSTALLED_APPS setting
Add a salesforce connection to your DATABASES setting:
'salesforce': { 'ENGINE': 'salesforce.backend', "CONSUMER_KEY" : '', "CONSUMER_SECRET" : '', 'USER': '', 'PASSWORD': '', 'HOST': 'https://test.salesforce.com', }
(optional) To override the default REST timeout of 3 seconds, define SALESFORCE_QUERY_TIMEOUT in your settings file.
(optional) If you want to use another name for your Salesforce DB connection, define SALESFORCE_DB_ALIAS in your settings file.
Add salesforce.router.ModelRouter to your DATABASE_ROUTERS setting:
DATABASE_ROUTERS = [ "salesforce.router.ModelRouter" ]
Define a model that extends salesforce.models.SalesforceModel
If you want to use the model in the Django admin interface, use a ModelAdmin that extends salesforce.admin.RoutedModelAdmin
You’re all done! Just use your model like a normal Django model.
Caveats
This package is in continuous development, and the ultimate goal is to support all reasonable features of the Salesforce platform, but for now here are the potential pitfalls and unimplemented operations:
Large Objects — Since the entire result set needs to be transferred over HTTP, and since Salesforce tends to use extremely long column counts in their tables, it’s assumed that users will create Django-Salesforce models that are specific to the individual app needs. Models with this library are for example and documentation purposes.
Custom Object Names — Custom Salesforce tables and columns (and a couple other SF concepts) are indicated with a double-underscore in the name, and will need to have their Django field name overridden (with ‘db_column’), so to not interfere with the double-underscore syntax used in Django query filters.
Inheritence — All models for object types on Salesforce must extend salesforce.models.SalesforceModel. The model router checks for this to determine which models to handle through the Salesforce connection.
Multiple Updates — Multiple update support is not yet implemented.
Multiple Deletes — Multiple delete support is not yet implemented.
Database Sync — There is no plan to support DB creation for the forseeable future.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-salesforce-0.1.6.2.tar.gz
.
File metadata
- Download URL: django-salesforce-0.1.6.2.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a90c4bcb2cce2c876af4dc9bd5af1be9acd19918a5a4dc65def7b3384d9c366 |
|
MD5 | 8d304868e5f186f6fcdd51af012c8058 |
|
BLAKE2b-256 | 82847ce5afd43ead9ecb5db476ed4ac09cea9d8df5634c7cec15d282182a1ba4 |