File: discount_code_creation.py

package info (click to toggle)
python-shopifyapi 12.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 560 kB
  • sloc: python: 1,752; sh: 10; makefile: 9
file content (17 lines) | stat: -rw-r--r-- 517 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from ..base import ShopifyResource
from .discount_code import DiscountCode


class DiscountCodeCreation(ShopifyResource):
    _prefix_source = "/price_rules/$price_rule_id/"

    def discount_codes(self):
        return DiscountCode.find(
            from_="%s/price_rules/%s/batch/%s/discount_codes.%s"
            % (
                ShopifyResource.site,
                self._prefix_options["price_rule_id"],
                self.id,
                DiscountCodeCreation.format.extension,
            )
        )