* Add .nvmrc file to longclaw/client to keep us all on the same version of node
It's also inline with the version of node that is used in the github actions workflow
* Adding some further documentation to the README.md
It should help people to understand the current status of the project and
how to get started with development.
* Let github actions run on all branches
* Test py 37,38,39 (#1) dj 22 wt 211,212,213
* Fixes the template include issue with the lock/unlock menu item
* Pin the upper bound of the supported Wagtail version to 2.13 and Django to 2.2
* Add some initial documentation for development setup
* add test for get_shipping_cost with a basket rate
* add fields to allow us to tie shipping rate to a basket & address
* add test for testing specified address and basket
* add migration for new shipping rate fields
* add missing import
* fix name errors
* add shipping possibilities based on shipping address and basket id
* test basket, shipping address, & basket+shipping address rate assignment
* return correct rates for basket and address rate cases
* rename shipping rate address for clarity (origin/destination)
* send basket modified signal when basket is modified via api endpoints
* test address only rate
* remove basket rates when the basket_modified signal is sent
* show response content on error
* print response content on failure for more tests and include more 200
statuses for put
* getting different status codes back from our endpoints, check success
* clear shipping rates based on destination address when address modified
* allow get params
* return cost and rate options for more cases (test not complete)
* fix mock
* return applicable shipping options and test some combinations
* stub the rate processor interface
* add fk from rate to processor that created it
* set rate basket and destination
* shipping processor instance can apply to more than one country
* run processor get_rates if configured
* let child models handle assignment
* add some initial testing for processor
* rename _get_rates() to process_rates()
* allow disabling the success check
* test country shipping option with processor requires destination
* test that the endpoint calls get_rate on the processor
* test that multiple processors are called once
* add shipping_origin fk to site settings
* add default cache key based on origin, destination, & basket items
* test a trivial rate processor implementation is used
* test cost endpoint returns the processed rate
* pin version requirement
* fix wagtail version
* start vagrant config
* get tox to run
* install nvm for vagrant user
* add instructions to move npm deps off shared folder for speed
* compact into a shell script for ease of use
* add some more examples as temporary documentation
* tests require dev reqs
* clean this up a little
* add migrations for productrequest app to fix test runner
* raise exception on error instead of returning error response
* test exception raised when country and country code specified
* test for destination address does not exist
* test exception when country and country code are not supplied
* set request.site as it is expected
* test get_shipping_cost_kwargs with only country code
* check the basket id and the settings
* value passed for country is supposed to be PK
* test with country specified
* write test so we can test with iso as string of known value
* tes destination is respected
* test with destination and country code
* test shipping_rate_name is set as name
* move models
* rename models.py
* rename to be consistent with rates being plural
* move serializers
* move models
* ignore private vagrant subdir
* move code around to fix circular imports to allow top level imports
* move address serializer import to top level
* ws
* ws
* Compatibility with Wagtail 2 and Django 2
* Fixes#154
Wagtail 2 compatibility:
* Fixes references to Wagtail packages which use the `wagtail.wagtail*` naming scheme. Wagtail 2 removes the redundancy.
* Wraps imports in `try`/`except` blocks to maintain compatibility with Wagtail 1.
Django 2 comaptibility:
Included because Wagtail 2 adds support for Django 2.
* Adds `on_delete` to all `ForeignKey` model fields, which is now required by Django 2.
* Updates for wagtail 2
* rename modules
* Longclaw v2: Rename and new migrations
* Longclaw 2: Reduce fails to 2 errors
* Longclaw v2: All tests passing
* Update travisconf
* Travis: Enable py37
* Update project template for v2
* longclawv2: update project template
* Fix migrations for longclaw 2
* Corrections in project template for longclaw1.0
* Correct location of templates and update docs
* Automatically load shipping countries
* Add loadcountries command
* Add info on loading country data
* [FIX] quantity in api.BasketViewSet.destroy gets unicode instead of int
* from rest_framework.decorators import detail_route, list_route
from rest_framework import permissions, status, viewsets
from rest_framework.response import Response
from longclaw.longclawbasket.models import BasketItem
from longclaw.longclawbasket.serializers import BasketItemSerializer
from longclaw.longclawbasket import utils
from longclaw.utils import ProductVariant
class BasketViewSet(viewsets.ModelViewSet):
* [FIX] RE: quantity in api.BasketViewSet.destroy gets unicode instead of int
This change anchors the longclaworders API URLs with a '^' to ensure they can't
confusingly match 'ANYTHING/api/order/...'. Also forces the order loading
JavaScript to use an absolute URL.
I'm not sure that this is the best architectural solution, but it resolves the
issues I'm having at least.
Fixes#131.