DEFAULTED_ON_CREATE not supported in alternate testing DB?
See original GitHub issueHi! I’ve successfully set up an alternate testing DB with SQLite as instructed in the readme, however when running my tests, I get the following error:
django.db.utils.InterfaceError: Error binding parameter 1 - probably unsupported type
This appears to come from a field I have defined as:
is_active = models.BooleanField(custom=True,
db_column='Is_Active__c',
default=models.DEFAULTED_ON_CREATE)
A quick look at the execute
method in django/db/backends/sqlite3/base.py
reveals that the Is_Active__c
param that django is trying to save is:
<salesforce.backend.operations.DefaultedOnCreate object at 0x10f233c50>
… instead of True/False. Changing that param value to either True or False while debugging does indeed solve the problem.
Is there a known issue working with DEFAULTED_ON_CREATE in alternate DBs? Am I missing some kind of configuration?
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
django-salesforce - PyPI
Note that Django 1.4.x is not compatible with Python 3. ... Migrations - Migrations can be used for an alternate test database with...
Read more >California Assessment Accessibility Resources Matrix
Part 4—Instructional Supports and Resources for the Alternate Assessments ... A student is not permitted to use keyboarding assistance in the test.
Read more >Alternate ACCESS for ELLs - WIDA
Alternate ACCESS for ELLs (Alternate ACCESS) is a large-print, paper-based test individually administered to students in grades 1-12 who are identified as ...
Read more >Hawaii State Alternate Assessments - HSA-Alt - alohahsap.org
The HSA-Alt Interim Assessments are not mandatory assessments. ... designated support, Translated Test may be set in TIDE by the Test.
Read more >2022-2023 NSCAS Not Tested Codes (NTC)
Alternate Assessment. Student took the NSCAS Alternate assessment and is not included in results from this testing vendor. ADVISER data must support coding....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Most problems are already solved by the PR for version 1.0.
Instead of your proposal
testing_default
a parameter for DefaultedOnCreate() is implemented, e.g.:A documentation for it is in wiki Introspection and Special Attributes of Fields.
Missing part: tests (a new test project that runs on Salesforce then on ‘default’ and possibly also with and without migrations)
The right solution should be simpler then A), B) or your code.
The algorithm of
inspectdb
command was stable long time and it ignored default values that were useful only with non-Salesforce databases.I wrote a patch for
inspectdb
to export more information, e.g.
Nothing is changed in the backend implementation yet, but you can still simplify your code by:
(not fixed, but a progress)
A problem is also in Salesforce with objects that were just created if they are saved once more without previous refreshing fields that were assigned by Salesforce defaults. We can try a special request that writes some fields and reads some fields in the same request. Useful for those fields with
sf_read_only
attribute (e.g. a formula that depends on ohter fields) or withDefaultedOnCreate
No field on the Salesforce platform expects a default value from the application.