• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JBKahn / django-sharding / 43
90%

Build:
DEFAULT BRANCH: master
Ran 06 Jun 2016 04:17PM UTC
Jobs 5
Files 21
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
43

push

travis-ci

JBKahn
Automatic db selection from filter() and create() arguments (#27)

* Added manager and queryset for automatic shard selection in the router

* Updated custom ShardQueryset to call super() functions to help handle django updates to the base method rather than returning on their own

* Updated model_config decorator to take an optional "sharded_by_field" argument that stores the field as an attribute and sets the default manager for the model to ShardManager

* Updated the router to use the new optional sharded by field on the model to get the correct shard based on the arguments passed to filter,create,get,etc. The default behavior is unchanged so existing models do not need any changes

* Fixed a bug with staticmethod not working properly in the manager

* Fixed a bug with staticmethod not working properly in the manager

* Updated logic for grabbing the shard in the router when the instance does not know what shard it should be on but there in a sharded by field defined

* Fixed multiple syntax errors in the router where it would look up the wrong values on accident

* Created a base model for sharding to go along with the decorator. All the base model does is set the manager. Unfortunately, this cannot be done in the decorator for some reason (I cannot figure out why, it simply doesnt work correctly)

* Updated the model instace create function to copy out the kwargs before instantiating the object with them, just in case the parent class messes with the kwargs later

* Updated tests for filter() and create() shard auto detection (no more using())

* Fixed a bug in a test where the user created does not get pk=1

* Refactored the common logic for getting the shard in the router per the github comment. Removed the deletes from the unit tests after adding the unit test settings for multiple DBs

* Removed the test case settings from github comment, they did not work with CI environment

* Removed the requirement for inheriting from ShardedModel. Added checks + manager assignment to decorator function to deal with the sharded_by_field.

* Updated docs to include the `sharded_by_field` information

* Updated error messaging when dealing with an abstract base class and the automatic routing manager

* Updated test name

* Removed todo lines for docs that have been completed

* Fixed a typo

* Removed extra import that is no longer needed

* Removed some commented out code in the manager

* Updated tests to make sure exceptions are being rased correctly when dealing with abstrat base classes and the sharded_by_field

* Added more decorator tests

* Added test db settings

* Removed delete()'s from tests, travis did not error with the test db settings like circle'

* Commented out test settings again, pretty sure its breaking the CI

* Removed duplicate function declaration in docs

* Removed TestCase import from runtests: not needed for testing with Travis

494 of 526 relevant lines covered (93.92%)

4.69 hits per line

Jobs
ID Job ID Ran Files Coverage
2 43.2 (TOX_ENV=py27-dj19) 06 Jun 2016 04:17PM UTC 0
93.35
Travis Job 43.2
4 43.4 (TOX_ENV=py34-dj18) 06 Jun 2016 04:17PM UTC 0
93.92
Travis Job 43.4
5 43.5 (TOX_ENV=py34-dj19) 06 Jun 2016 04:17PM UTC 0
93.92
Travis Job 43.5
7 43.7 (TOX_ENV=py35-dj18) 06 Jun 2016 04:18PM UTC 0
93.92
Travis Job 43.7
8 43.8 (TOX_ENV=py35-dj19) 06 Jun 2016 04:19PM UTC 0
93.92
Travis Job 43.8
Source Files on build 43
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #43
  • e92cff92 on github
  • Prev Build on master (#38)
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc