This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Added more criterions to lfs based shop

Installation

installation is simple

pip install lfs-criterion-extra

or

pip install git+https://github.com/suvit/lfs-criterion-extra

After instalation of the package you should add lfs_criterion_extra to INSTALLED_APPS before lfs app. This is because, this app overwrite lfs templates.

After that you needed to add tables in db

python manage.py syncdb

That`s all.

Usage

lfs-criterion-extra patch lfs criterions modules to support new criterions. After patching you may use several new criterions:

  • OrderCountCriterion
    checks closed order count of request.user
  • GroupCriterion
    checks request.user is in saved group(s)
  • CategoryCriterion
    checks product or products in cart are in saved categories
  • ProductCriterion
    checks product or products in cart are in saved list of products
  • OrderCompositionCriterion
    checks that in cart
  • DiscountCriterion
    checks that saved discounts are valid or unvalid
  • OrderSummCriterion
    checks closed order summ of prices
  • ManufacturerCriterion
    checks product`s manufacturer is in saved list of manufacturers
  • TimeCriterion
    checks now time to compare with saved time
  • CartAmountCriterion
    checks cart amount
  • MaxWeightCriterion
    chacks max weight of the products in cart
  • ForSaleCriterion
    checks product or products in cart are for_sale
  • ManualDeliveryTimeCriterion
    checks product or products in cart are with manual delivery time
  • FullUserCriterion (AdvancedUserCriterion)
    added ability to check that user is anonymous or not.
  • ProfitCriterion (not worked with base lfs, needed prices from supplier)
    checks product profit

You may choose new criterions from criterion`s tab of delivery and payment methods.

Added own criterions

You may inherit Criterion or NumberCriterion

from lfs_criterion_extra.models import Criterion, NumberCriterion

class FooCriterion(NumberCriterion):

foo = models.DecimalField(‘FOO’)

‘may be other model fields’

value_attr = ‘foo’ # from that attribute get value to compare content_type = ‘foo’ # internal id of the criterion name = ‘Foo’ # displayable value

def is_valid(self, request, product=None):
how_many_foo = product.name.count(‘foo’) return self.test_value(how_many_foo)

that`s all, your criterion is appeared in the criterion list.

TODO

  • move monkey.py to lfs.criterion.core (merge or move to lfs 0.8)
  • write tests
Release History

Release History

0.2.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.9

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
lfs_criterion_extra-0.2.0.zip (29.2 kB) Copy SHA256 Checksum SHA256 Source Nov 3, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting