Open
Conversation
Making changes to `django.conf.settings` is *bad* and can have negative side-affects on other apps. This has been yanked, and all settings can now be set via environment cariables. Additionally, automatically configuring balanced has been moved into models.py. This is historically where you do things that need to be done on startup, but after settings have been created (see also: registering signal listeners). This can be revisited when the app refactor lands in Django 1.7.
Balanced should be configured when things start running, there's really no reason to configure it on every request.
To run the tests:
$ py.test tests/ --cov django_balanced --cov-report term-missing --pep8 django_balanced
- Move Model forms out of admin.py and into forms.py.
- Refactor how admin forms work.
Instead of modifying fields directly, we now override .get_form()
to return to appropriate add/change form. This allows us more
flexibility in how the form is setup, validated, and saved.
TODO: logic in model_save() should probably be moved to the
respective models .save()
- Refactor bulk payouts.
The view logic has been moved out of the admin and into to a
class-based view. The page is now driven by forms/formsets,
giving it proper validation, and template has been updated.
- Disable the Credit change form
Since Credit's cannot be changed once created, the change_form
template has been override to hide the form.
django_balanced/formsets.py
Outdated
Contributor
There was a problem hiding this comment.
escrow can be cached for test marketplaces so it's possible to have a race condition where the escrow is not updated in time, it's usually only a second or two at the most but this can raise its head in testing where you're doing operations one after the other. i usually recommend that you just try the credit instead since Balanced will recalculate the escrow during write operations.
Contributor
|
@dmpayton can you please throw a link to the travis build in the README too? this is looking great 🎸 |
- Use the apps registry (if available) to register listeners, with a fallback import in models.py - The post_sync listener doesn't care about any of the kwargs passed to it. Tests pass with Django 1.7b4. 👍
- Create run-tests.sh script for quickly running the tests with common options. Update Travis-CI and tox to use this. - Update how Travis-CI specifies Django versions for clarity.
Author
|
A little cleanup, Django 1.7 compatibility, and an updated README. @mjallday, anything else you'd like to see in there? |
Contributor
|
can you please put this in the top of the README |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As requested in #11, I've created this PR to take a closer look at getting my updates merged in. Thanks!