This file contains 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 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 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 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 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 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 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 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 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, |
This file contains 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> | |
<html> | |
<title> Jerinisready | Custom Template | Inspired From W3Schools </title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway"> | |
<style> | |
body,h1,h2{font-family: "Raleway", sans-serif}body, html {height: 100%} | |
.bgimg {min-height: 100%;background-image: url("https://www.w3schools.com/w3images/wedding_couple.jpg");background-position: center;background-size:cover;} |