remove refererences to miscutils
new file: make_post_sell/lib/currency.py modified: make_post_sell/models/cart.py modified: make_post_sell/models/coupon.py modified: make_post_sell/models/price.py modified: make_post_sell/models/product.py modified: make_post_sell/views/product.py
This commit is contained in:
parent
82ae89d244
commit
cbc659ed86
6 changed files with 16 additions and 19 deletions
5
make_post_sell/lib/currency.py
Normal file
5
make_post_sell/lib/currency.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def dollars_to_cents(dollars):
|
||||
return int(float(dollars) * 100)
|
||||
|
||||
def cents_to_dollars(cents):
|
||||
return int(cents) / 100.0
|
||||
|
|
@ -29,11 +29,9 @@ from .shop import get_shops_by_ids
|
|||
|
||||
from .cart_coupon import CartCoupon
|
||||
|
||||
from miscutils import (
|
||||
timestamp_to_ago_string,
|
||||
dollars_to_cents,
|
||||
cents_to_dollars,
|
||||
)
|
||||
from miscutils import timestamp_to_ago_string
|
||||
|
||||
from ..lib.currency import cents_to_dollars
|
||||
|
||||
try:
|
||||
unicode("")
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ from .meta import (
|
|||
|
||||
from .cart_coupon import CartCoupon
|
||||
|
||||
from miscutils import (
|
||||
datetime_to_timestamp,
|
||||
timestamp_to_datetime,
|
||||
from miscutils import datetime_to_timestamp, timestamp_to_datetime
|
||||
|
||||
from ..lib.currency import (
|
||||
dollars_to_cents,
|
||||
cents_to_dollars,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -6,10 +6,7 @@ from .meta import Base, RBase, UUIDType, foreign_key, now_timestamp
|
|||
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from miscutils import (
|
||||
dollars_to_cents,
|
||||
cents_to_dollars,
|
||||
)
|
||||
from ..lib.currency import cents_to_dollars
|
||||
|
||||
|
||||
class Price(RBase, Base):
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ from make_post_sell.lib.render import markdown_to_html
|
|||
|
||||
from slugify import slugify
|
||||
|
||||
from miscutils import (
|
||||
from ..lib.currency import (
|
||||
dollars_to_cents,
|
||||
cents_to_dollars,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from pyramid.view import view_config
|
||||
|
||||
from pyramid.httpexceptions import HTTPFound
|
||||
|
||||
from . import (
|
||||
user_required,
|
||||
shop_editor_required,
|
||||
|
|
@ -8,12 +10,7 @@ from . import (
|
|||
|
||||
from ..models.product import Product
|
||||
|
||||
from pyramid.httpexceptions import HTTPFound
|
||||
|
||||
from miscutils import (
|
||||
dollars_to_cents,
|
||||
cents_to_dollars,
|
||||
)
|
||||
from ..lib.currency import dollars_to_cents
|
||||
|
||||
|
||||
def checkbox_to_bool(checkbox):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue