kopia lustrzana https://github.com/longclawshop/longclaw
rodzic
109b7b214c
commit
2594246221
|
@ -5,11 +5,11 @@ cache: pip
|
|||
|
||||
matrix:
|
||||
include:
|
||||
- env: TOX_ENV=py35-django-213
|
||||
- env: TOX_ENV=py35-django-225
|
||||
python: 3.5
|
||||
- env: TOX_ENV=py36-django-213
|
||||
- env: TOX_ENV=py36-django-225
|
||||
python: 3.6
|
||||
- env: TOX_ENV=py37-django-213
|
||||
- env: TOX_ENV=py37-django-225
|
||||
python: 3.7
|
||||
dist: xenial
|
||||
sudo: true
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from rest_framework.decorators import detail_route, list_route
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework import permissions, status, viewsets
|
||||
from rest_framework.response import Response
|
||||
from longclaw.basket.models import BasketItem
|
||||
|
@ -85,7 +85,7 @@ class BasketViewSet(viewsets.ModelViewSet):
|
|||
return Response(data=serializer.data,
|
||||
status=status.HTTP_200_OK)
|
||||
|
||||
@list_route(methods=['get'])
|
||||
@action(detail=False, methods=['get'])
|
||||
def total_items(self, request):
|
||||
"""
|
||||
Get total number of items in the basket
|
||||
|
@ -96,7 +96,7 @@ class BasketViewSet(viewsets.ModelViewSet):
|
|||
|
||||
return Response(data={"quantity": n_total}, status=status.HTTP_200_OK)
|
||||
|
||||
@detail_route(methods=['get'])
|
||||
@action(detail=True, methods=['get'])
|
||||
def item_count(self, request, variant_id=None):
|
||||
"""
|
||||
Get quantity of a single item in the basket
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from rest_framework import viewsets, permissions, status
|
||||
from rest_framework.decorators import detail_route, list_route
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.response import Response
|
||||
|
||||
from longclaw.contrib.productrequests.serializers import ProductRequestSerializer
|
||||
|
@ -31,7 +31,7 @@ class ProductRequestViewSet(viewsets.ModelViewSet):
|
|||
|
||||
return response
|
||||
|
||||
@list_route(methods=['get'])
|
||||
@action(detail=False, methods=['get'])
|
||||
def requests_for_variant(self, request, variant_id=None):
|
||||
"""Get all the requests for a single variant
|
||||
"""
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from rest_framework.decorators import detail_route
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework import permissions, status, viewsets
|
||||
from rest_framework.response import Response
|
||||
from longclaw.orders.models import Order
|
||||
|
@ -10,7 +10,7 @@ class OrderViewSet(viewsets.ModelViewSet):
|
|||
permission_classes = [permissions.IsAdminUser]
|
||||
queryset = Order.objects.all()
|
||||
|
||||
@detail_route(methods=['post'])
|
||||
@action(detail=True, methods=['post'])
|
||||
def refund_order(self, request, pk):
|
||||
"""Refund the order specified by the pk
|
||||
"""
|
||||
|
@ -18,7 +18,7 @@ class OrderViewSet(viewsets.ModelViewSet):
|
|||
order.refund()
|
||||
return Response(status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
@detail_route(methods=['post'])
|
||||
@action(detail=True, methods=['post'])
|
||||
def fulfill_order(self, request, pk):
|
||||
"""Mark the order specified by pk as fulfilled
|
||||
"""
|
||||
|
|
|
@ -24,6 +24,7 @@ INSTALLED_APPS = [
|
|||
'django.contrib.contenttypes',
|
||||
'django.contrib.sites',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
|
||||
'wagtail.contrib.forms',
|
||||
|
@ -63,6 +64,7 @@ MIDDLEWARE = [
|
|||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'wagtail.core.middleware.SiteMiddleware',
|
||||
'wagtail.contrib.redirects.middleware.RedirectMiddleware',
|
||||
]
|
||||
|
@ -79,6 +81,7 @@ TEMPLATES = [
|
|||
'django.template.context_processors.debug',
|
||||
'django.template.context_processors.request',
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
'longclaw.configuration.context_processors.currency',
|
||||
],
|
||||
},
|
||||
|
|
8
setup.py
8
setup.py
|
@ -87,10 +87,10 @@ setup(
|
|||
],
|
||||
include_package_data=True,
|
||||
install_requires=[
|
||||
'django>=2.1',
|
||||
'wagtail>=2.3',
|
||||
'django-countries>=5.3.2',
|
||||
'django-extensions>=2.1.4',
|
||||
'django==2.2.5',
|
||||
'wagtail==2.6.2',
|
||||
'django-countries==5.5',
|
||||
'django-extensions==2.2.1',
|
||||
'djangorestframework>=3.9.0',
|
||||
'django-ipware>=2.1.0'
|
||||
],
|
||||
|
|
4
tox.ini
4
tox.ini
|
@ -1,13 +1,13 @@
|
|||
[tox]
|
||||
envlist =
|
||||
{py35,py36,py37}-django-213
|
||||
{py35,py36,py37}-django-225
|
||||
[testenv]
|
||||
setenv =
|
||||
PYTHONPATH = {toxinidir}:{toxinidir}/longclaw
|
||||
commands = coverage run --source longclaw runtests.py
|
||||
coverage xml --omit=*/apps.py,*/migrations/*,*/__init__.py,*/gateways/braintree.py,*/gateways/stripe.py,*/bin/longclaw.py
|
||||
deps =
|
||||
django-213: Django==2.1.3
|
||||
django-225: Django==2.2.5
|
||||
-r{toxinidir}/requirements_dev.txt
|
||||
basepython =
|
||||
py37: python3.7
|
||||
|
|
|
@ -91,18 +91,12 @@ class Index extends React.Component {
|
|||
</Container>
|
||||
);
|
||||
|
||||
const FeatureCallout = () => (
|
||||
<div
|
||||
const QuickStart = () => (
|
||||
<Block layout="twoColumn">
|
||||
className="productShowcaseSection paddingBottom"
|
||||
style={{textAlign: 'center'}}>
|
||||
<h2>Features</h2>
|
||||
<ul>
|
||||
<li>Fully customisable product catalog management. Capture any attribute of your product</li>
|
||||
<li>Fully integrated with Wagtail - Use all features of Wagtail as normal (add a blog, articles or any other wagtail plugin)</li>
|
||||
<li>Multiple payment backend integrations; Stripe, Braintree, Paypal...</li>
|
||||
<li>Dashboard view in the Wagtail admin shows statistics about your shop</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2>Quick Start</h2>
|
||||
</Block>
|
||||
);
|
||||
|
||||
const Support = () => (
|
||||
|
@ -215,6 +209,7 @@ class Index extends React.Component {
|
|||
<HomeSplash siteConfig={siteConfig} language={language} />
|
||||
<div className="mainContainer">
|
||||
<Features />
|
||||
<QuickStart />
|
||||
<Support />
|
||||
<Showcase />
|
||||
</div>
|
||||
|
|
Ładowanie…
Reference in New Issue