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
<table border="1" cellspacing="0" cellpadding="2"> | |
<tbody> | |
<tr> | |
<td valign="top" align="left" nowrap=""> | |
<table width="570" border="0" cellpadding="5" cellspacing="0"> | |
<tbody> | |
<tr> | |
<td width="410" valign="top" align="left"> | |
<font id="copyreviews" face="Arial, Helvetica, sans-serif" size="2" color="#FF6600"> | |
<a target="_blank" href="{{ domain }}/{{ dentist.get_slug }}"> |
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 math | |
PAGINATE_BY = 10 | |
ALL_PAGES = 'all pages' | |
def paginator(page, data_objects, objects_count=None): | |
paginate = PAGINATE_BY | |
page = int(page) | |
next = PAGINATE_BY * page |
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_search_results(self, request, queryset, search_term): | |
queryset, use_distinct = super(OogleUserAdmin, self).get_search_results(request, queryset, search_term) | |
if search_term.isdigit(): | |
queryset = self.model.objects.filter(Q(id=search_term) | Q(dentist__dentist_id=search_term) | Q(login_dentist__dentist_id=search_term)) | |
sort_param = request.GET.get('o', '').split('.') | |
full_sort_param = [] | |
index = 1 | |
for field in self.list_display: | |
for param in sort_param: | |
if str(index) in param: |
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
class DentistAdmin(admin.ModelAdmin): | |
list_display = ['dentist_id', | |
'first_name', | |
'last_name', | |
'id', | |
'state', | |
'city', | |
'zipcode_zip', | |
] |
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
MISTAKE_COUNTS = 4 | |
def check_word(string_one, string_two): | |
string_one = string_one.lower() | |
string_two = string_two.lower() | |
found_count = len(string_one) - len(string_one) / MISTAKE_COUNTS | |
result = [] | |
for index in xrange(0, len(string_two)): | |
not_found, found = 0, 0 | |
try: |
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
gulpfile.js | |
var gulp = require('gulp'); | |
var uglify = require('gulp-uglify'); | |
var minify = require('gulp-minify-css'); | |
var concat = require('gulp-concat'); | |
var watch = require('gulp-watch'); | |
var gutil = require('gulp-util'); | |
var babel = require('gulp-babel'); | |
var sass = require('gulp-sass'); |
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
< Django view > | |
paginator = Paginator(data['photos'], PAGINATE_BY) | |
page = request.GET.get('page', 1) | |
try: | |
data['photos'] = paginator.page(page) | |
except PageNotAnInteger: | |
data['photos'] = paginator.page(1) | |
except EmptyPage: | |
data['photos'] = paginator.page(paginator.num_pages) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os, time | |
def main(): | |
menu() | |
# Ввод начальных параметров | |
secter_key = raw_input("Введите ключ - ") | |
text = raw_input("Введите текст - ") |
NewerOlder