Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Road to 1.0.0 #12

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Conversation

dmpayton
Copy link

As requested in #11, I've created this PR to take a closer look at getting my updates merged in. Thanks!

dmpayton added 10 commits March 11, 2014 12:43
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.
if any(self.errors):
return
balanced.bust_cache()
escrow = balanced.Marketplace.my_marketplace.in_escrow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mjallday
Copy link
Contributor

@dmpayton can you please throw a link to the travis build in the README too? this is looking great 🎸

dmpayton added 12 commits June 6, 2014 21:00
- 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.
@dmpayton
Copy link
Author

A little cleanup, Django 1.7 compatibility, and an updated README. @mjallday, anything else you'd like to see in there?

@mjallday
Copy link
Contributor

can you please put this in the top of the README

[![Build Status](https://travis-ci.org/balanced/django-balanced.svg)](https://travis-ci.org/balanced/django-balanced)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants