eserge eserge

View gist:3426706
1 2 3 4 5 6 7 8 9 10
 
{% block extrahead %}{{ block.super }}
{% url 'admin:jsi18n' as jsi18nurl %}
<script type="text/javascript" src="{{ jsi18nurl|default:"../../../jsi18n/" }}"></script>
{{ media }}
<script src="{{STATIC_URL}}js/jquery-ui-1.8.17.custom.min.js"></script>
<script>
function jqVersion() {
alert(jQuery.fn.jquery);
}
View gist:1926536
1 2 3 4 5 6 7 8 9 10
class LoginMixin(object):
"""Mixin for securing a class.
 
Taken from here:
https://groups.google.com/d/msg/django-users/g2E_6ZYN_R0/tnB9b262lcAJ
"""
 
def do_logout(self, request):
"""Logs the user out if necessary."""
logout(request)
View gist:1754504
1 2 3 4 5 6 7 8 9
# -*- coding: utf-8 -*-
from django.forms.models import ModelForm
from django import forms
from models import Profile
import bleach
 
class EditProfileForm(ModelForm):
phone = forms.CharField(required=False,
help_text=u"Рекомендуемый формат: +74951234567")
View gist:1729974
1 2 3 4 5 6 7 8 9 10
function hightlight(highlight_string, part){
workstring = highlight_string;
var indices = [];
var cut = all_cut = 0;
while (workstring.indexOf(part) != -1) {
index = workstring.indexOf(part);
indices.push(index+all_cut);
cut = index + part.length;
workstring = workstring.substr(cut);
all_cut = all_cut + cut;
View gist:1606523
1 2 3
$("#control_checkbox").click(function(){
$(".concealable").css('display', (this.checked)?"block":"none");
});
View gist:1605923
1 2 3 4 5 6 7 8 9 10
def random_string(length):
'''visually similar characters were deliberately removed'''
import random
letters = u"346789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY"
return "".join([letters[random.randint(0,len(letters)-1)] for i in range(length)])
 
 
if __name__ == "__main__":
for i in range(10):
print random_string(10)
View modifiers.py
1 2 3 4 5 6 7 8 9 10
# -*- coding: utf-8 -*-
import decimal
from django.conf import settings
from shop.cart.cart_modifiers_base import BaseCartModifier
 
 
class FixedShippingCosts(BaseCartModifier):
# """
# This will add a fixed amount of money for shipping costs.
# """
Something went wrong with that request. Please try again.