Django Salesforce Versions Save

Salesforce integration for Django's ORM using the SF REST API.

v5.0.1

2 months ago
  • Add: Support for db_default field option in Django 5.0. It allows a seamless support of the defaultedOnCreate counterpart in Salesforce.
  • Add: Support for Salesforce API 60.0 Spring '24.
  • Change: Values of FloatField are now really float, not Decimal as previously.
  • Fix: Compatibility with the current django-debug-toolbar #322
  • Fix: Introspection inspectdb of custom editable name fields #308
  • Add: FloatField is used by inspectdb for some metadata with negative decimal places that are new in API 60.0.
  • Change: A license code is required also in the first half of lifetime of a LTS version unless the AGPL licence is accepted. Django 4.2 LTS will be unlocked together with unlocking 5.0 in August 2024 in Django-salesforce 5.1 release.
  • Change: License code validity may not transfer to the next django-salesforce version if sponsorship ended.

v5.0

5 months ago

When you're ready to use django-salesforce with Django v5.0, please start a GitHub Sponsorship. You'll receive a license key.

This release contains mostly a series of small changes to enable Django v5.0 support.

What's Changed

v4.2

10 months ago

As part of this release, we're beginning a two-tiered licensing process to encourage sponsorship from users who run this library in a commercial context. All sponsorship dollars go directly to the developer and support continued features and maintenance.

When you're ready to use django-salesforce with Django v4.2, you have a choice between:

  • Continue using this library, and start a GitHub Sponsorship. You'll receive a license key.
  • Switch to the AGPL licensed version of django-salesforce

What's Changed

  • Add: Basic diagnostics after installation can be done by command python manage.py check --database=salesforce
  • Change: Use with Django 4.2 requires an enterprise license key.
  • Add: Support for Django 4.2
  • Use API 58.0 Summer '23
  • Add: Support for Django Database caching #315
  • Fix: Configurable max introspected pick-list size SF_MAX_INSPECTDB_PICKLIST_LENGTH #312 Some people need to introspect huge picklists, some don't want.

New Contributors

Full Changelog: https://github.com/django-salesforce/django-salesforce/compare/v4.1...v4.2

v4.1

1 year ago
  • Add: Support for Django 4.1
  • Add: Command inspectdb can introspect actual default values of fields from a defaultValueFormula if it is a simple constant like a number or a string.
  • Fix: A default value DefaultedOnCreate(value) is no longer created by inspectdb in favour of a simple value. If a simple default value can not be known then a generic DEFAULTED_ON_CREATE is still used rarely for default values created by a complicated or unknown function only on Salesforce side. #280
  • Fix: Optionally don't use redundant table names before field names if queried with .sf(minimal_aliases=True); important for some special system objects #302
  • Fix: Tests with the newest Django, Salesforce, Python; including Python 3.11(beta)
  • Fix: Extended SalesforceModel with PostgreSQL backend and Django >= 3.0 #299

v4.0

2 years ago

In anticipation of the upcoming release of Django 4.0, we're proud to release django-salesforce v4.0!

  • Add suport for Django 4.0 (rc 1), API 53.0 Winter '22, tests with Python 3.10
  • Remove: Python 3.5
  • Fix: Invalid primary key from bulk_create() with one object in Django 3.0.x #298
  • Internal change: The default row type from salesforce Cursor is now a tuple, not a list
  • Add: Support timestamps with "auto_now_add=True" and "auto_now=True".
  • Fix: Fix tests for Salesforce API 52.0 Summer '21 that broke the evaluation of .filter(field__gt=''). Method .exlude(field=None) must be used.
  • Fix: Works also with obsoleted USE_TZ=False #221
  • Fix: Support also alternative clones of Beatbox #172
  • Add: Implement queryset.bulk_update() method #236
  • Fix: SOQL command in queryset.raw() is supported case insensitive
  • Fix: ManyToMany relationships compiled also with GROUP BY, HAVING, ORDER BY. #264
  • Fix: Lookup IsNull() in 'queryset.filter(...=None).update(...)' #283
  • Fix: DefaultedOnCreate() to work with new sqlite3 and new Django
  • Fix: Command inspectdb with --table-filter=regex_pattern
  • Fix: Count('*') and Count(... distinct=True)
  • Add: Simple authentication by auth.SimpleSfPasswordAuth(). #282
  • Add: Higher 'threadsafety=2' level of the driver. Every thread can use its own database connections with the same alias, but checked that the same thread can not open more connections with the same alias.
  • Add: Test for big SOQL queries of length almost 100000 bytes
  • Add: Strict typing of SalesforceModel and all salesforce/*.py code. All dependent user code can use also strict typing now.
  • Add: Method .explain(...)
  • Fix: Low level EXPLAIN command
  • Add: Decorator 'PatchedSfConnection(... use_debug_info ...)' to can check the executed SOQL in tests e.g. for aggregate() method.
  • Add: Verbose error message in authentication.
  • Add: Support offline tests with playback by MockTestCase, also for tests of database error handling.
  • Fix: Example models can now create a migration
  • Fix: Check pylint, increase code coverage (91%)
  • Fix: Tests updated for Salesforce API 52.0 Summer '21
  • Remove: Unused code, mostly residues from old Django versions
  • Add: Prepare for DynamicWebAuth; Configurable username in RefreshTokenAuth Still requires a low level user code in middlewawe. (therefore considered as undocumented alpha code.)

v3.2

3 years ago

Support for Django 3.2

  • and removed code for Django 1.11

Better 'inspectdb':

  • If you select a subset of table names that should created by inspectdb then the output of models.py will be valid without need to fix relationships to these tables by editing. See details below.
  • Huge choices=[...] attributes are ignored if they are longer than 4000 characters of code. In practice, this only applies to a list of all countries in the world in every address field and also to every time zones field. These are never expected to be repeated inline.
  • Add: Fields OneToOneField are detected by inspectdb in Django >= 3.0

Other

  • Updated API version to use Salesforce 51.0 Spring '21 API
  • Fixed backward compatibility with old migrations
  • Fixed all hidden deprecation warnings

Example of inspectdb:

$ python manage.py inspectdb --database=salesforce Account Contact ... >models.py

If the table User is not in the list of used tables then this foreign key to a User is not created automatically in the model:

created_by = models.ForeignKey('User',... , db_column='CreatedById',...)

and a CharField is created instead that can be used to access its raw data:

created_by_id = models.CharField(db_column='CreatedById', max_length=18,...)  # References to missing tables: ['-User']

You can delete all fields with the text # References to missing tables alternatively.

v3.1

3 years ago

This release officially adds support for the GA release of Django 3.1, and also introduces a new scheme for versioning.

It's quite important for us to track compatibility with the Django core release process, so moving forward we'll be matching the major and minor versions of our releases with the same numbers of the main supported Django release.

We've actually been following the Django Deprecation Timeline for some time, so other than a big bump in versions, this should have little effect on your projects moving forward.

v1.1

3 years ago

A few housekeeping changes in this release, with a focus on authentication, specifically dynamic or custom authorization procedures.

  • Add: Support for custom authentication modules configurable by settings.DATABASES['salesforce']['AUTH']
  • Add: Authentication by Salesforce CLI SFDX application for developers, e.g. 'salesforce.auth.SfdxOrgWebAuth'
  • Add: Configurable API_VERSION via settings.DATABASES['salesforce']['API_VERSION']
  • Add: A method .sf() on querysets and managers to can pass additional parameter e.g. all_or_none=True or edge_updates=True to bulk_create() and update() methods.

v1.0

4 years ago

After many years we're pleased to finally be releasing a 1.0 version of django-salesforce. As part of this release we'll be dropping support for legacy versions of Django and Python, and adding substantial type hinting support.

  • Fix: Support for Django Debug Toolbar - including EXPLAIN command
  • Fix: Export more attributes by inspectdb for ForeignKey similarly to other fields. ("verbose_name", "help_text" and "default=DEFAULTED_ON_CREATE")
  • Fix: Don't export DEFAULTED_ON_CREATE excessively for not createable fields.
  • Fix: Error handling in bulk delete()
  • Add: Support for the current snapshot of Django 3.1-alpha
  • Remove: Support for Django 1.10 (incompatible with 3.1)
  • Remove: Support for Python 3.4 (not tested any more)
  • Add: Bulk update limited to 200 objects: bulk_update_small()
  • Add: Static typing by Mypy (requires django-salesforce-stubs 1.5.0.1)
  • Add: Raw cursor with fields dict: connection.cursor(name='dict')
  • Add: Internal module mocksf is used in tests/debugging for record or replay of raw Salesforce requests/responses.

Static typing: To support checking of code attributes and types on custom user models, @hynekcer has created django-salesforce-stubs, a fork of the django-stubs package. Internal annotation standards are largely dependent on the levels of annotation in the Django internals, while our salesforce.dbapi module is annotated and checked in --strict mode.

v0.9

4 years ago
  • Added: lookup .filter(...__not_in=subquery)' and 'not_eq', because of unsupported .exclude(...__in=subquery).
  • Added: command ping_connection that automatic called after every longer inactivity to minimize timeouts. Fixed #174
  • Added: salesforce.models_extend module with SalesforceModel with varchar primary key that works also with default databases. Fixed methods for it: save() and bulk_create() to can create a new pk or to copy an object exactly. Fixed #231
  • Updated for Django 3.0 beta 1
  • Updated for Salesforce 47.0 Winter '20
  • Various bug fixes