This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Any, Union | |
| from django.db.models import Q, QuerySet | |
| from django.http import HttpRequest | |
| from apps.api_set_v2.serializers.catalogue import ProductSimpleListSerializer | |
| from apps.catalogue.models import Product | |
| from apps.partner.models import StockRecord | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_status(code: int): | |
| """ | |
| This function will return a list of items | |
| """ | |
| _status_set = { | |
| 1: 'Alice', | |
| 2: 'Bob', | |
| 4: 'Charlie', | |
| 8: 'David', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from faker import Faker | |
| from random import randint, choice | |
| from oscar.core.loading import get_model | |
| from oscar.core.compat import get_user_model | |
| from oscar.apps.catalogue.reviews.models import ProductReview, Vote | |
| from oscar.apps.catalogue.models import Product | |
| from apps.users.models import User |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| AUTHOR jerinisready | |
| LICENSE : General Public License. Free to use, modify or publish unless u keep that open source. | |
| This is how I implemented (pricedrop upto 40%) column in django oscar. | |
| Basically StockRecord model have 2 fields, 'price_excl_tax' and 'price_retail'. | |
| What we want is (price_retail - price_excl_tax) * 100 / price_retail. | |
| We can use django's Expression wrapper to calculate the max offer price |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.db import models | |
| from oscar.apps.basket.abstract_models import AbstractBasket | |
| from django.utils.translation import gettext_lazy as _ | |
| class Basket(AbstractBasket): | |
| BUY_NOW, OPEN, MERGED, SAVED, FROZEN, SUBMITTED = ( | |
| "Buy Now", "Open", "Merged", "Saved", "Frozen", "Submitted") | |
| STATUS_CHOICES = ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PAYMENT_EVENT_PURCHASE = 'Purchase' | |
| PAYMENT_METHOD_STRIPE = 'Stripe' | |
| STRIPE_EMAIL = 'stripeEmail' | |
| STRIPE_TOKEN = 'stripeToken' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input type='text' class="mobile-number" /> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.2/css/intlTelInput.css" | |
| integrity="sha256-rTKxJIIHupH7lFo30458ner8uoSSRYciA0gttCkw1JE=" crossorigin="anonymous"/> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.2/js/utils.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.2/js/intlTelInput.js"></script> | |
| <style> | |
| .iti__flag { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <head> | |
| <title> Canvas Draw </title> | |
| </head> | |
| <body> | |
| <video id="can_video"></video> | |
| </body> | |
| <script> | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| _isenvsetas = lambda key, default=False: str(os.environ.get(key, ...)).upper() == str(default).upper() | |
| AUTH_PASSWORD_VALIDATORS = [ | |
| {'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, | |
| {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, | |
| {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, | |
| {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($){ | |
| var self=this, | |
| container, | |
| running=!1, | |
| currentY=0, | |
| targetY=0, | |
| oldY=0, | |
| maxScrollTop=0, | |
| minScrollTop, | |
| direction, |