Features
- Add `Router.bootstrap()`function, which automatically imports all `views` directories of all the registered apps in django. Also, it automatically registers the default ModelView of binder.
Old:
python
from binder.router import Router
from binder.views import ModelView
needed for binder.router to work
import cyrm.views noqa
import base.orders.views noqa
import ib.ib_orders.views noqa
....
import base.planning.views noqa
router = Router().register(ModelView)
api_urls = [
re_path('^', include(router.urls)),
]
New:
python
from binder.router import Router
router = Router.bootstrap()
api_urls = [
re_path('^', include(router.urls)),
]
- Allow callables for annotations, deferring their initializations until the corresponding view is initialized. Example:
python
class Annotations:
staticmethod
def ready_to_go_cb():
from base.orders.models import PlannedStep
return Exists(PlannedStep.objects.filter(works__works__route=OuterRef('pk')))
ready_to_go = ready_to_go_cb
- When using date-only syntax for filtering on DateTimeFields, ranges
are now inclusive of the end date, and "greater than" filters will
now do the right thing and skip the given date completely instead of
using midnight of that date as a starting point.
Bugfixes
- Fix error when `related_name=None`
Deprecations / removals