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 django.utils.translation import ugettext_lazy as _ | |
import plata | |
from plata.product.models import ProductBase, register_price_cache_handlers | |
from plata.shop.models import PriceBase | |
class Product(ProductBase): | |
"""(Nearly) the simplest product model ever""" |
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
class BaseCheckoutForm(forms.ModelForm): | |
""" | |
Needs self.request | |
""" | |
def clean(self): | |
data = self.cleaned_data | |
email = data.get('email') | |
create_account = data.get('create_account') |
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
class ProductAdmin(TranslationAdmin): | |
list_filter = ['is_active', 'categories', 'specification', 'upgrades'] | |
filter_horizontal = ['upgrades', 'categories', 'matching_products'] | |
form = FormWithSpecification | |
inlines = [ | |
PriceInline, | |
SpecialPriceInline, | |
EducationPriceInline, | |
ProductImageInline, | |
] |
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
# ------------------------------------------------------------------------ | |
# coding=utf-8 | |
# ------------------------------------------------------------------------ | |
from __future__ import print_function | |
from django.core.management.base import NoArgsCommand | |
from feincms.module.page.models import Page |
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
### Keybase proof | |
I hereby claim: | |
* I am matthiask on github. | |
* I am matthiask (https://keybase.io/matthiask) on keybase. | |
* I have a public key whose fingerprint is 9344 9375 29B4 1ED5 6141 194C 0C3F 200E F349 129F | |
To claim this, I am signing this object: |
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
<script type="text/javascript" src="/static/app/jquery-ui-1.11.4.custom.min.js"></script> | |
<style>#result_list tbody tr { cursor: move; }</style> | |
<script> | |
django.jQuery(function($) { | |
$('#result_list tbody').sortable({ | |
update: function(event, ui) { | |
$('#result_list tbody tr').each(function(index) { | |
var row = $(this); | |
row.find('.field-ordering input').val(10 * (index + 1)); | |
row.removeClass('row1 row2').addClass((index % 2) ? 'row2' : 'row1'); |
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
server { | |
listen *:80; | |
server_name ...; | |
root /home/www-data/.../htdocs; | |
error_log /home/www-data/logs/....error.log; | |
access_log /home/www-data/logs/....access.log combined; |
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
const Botkit = require('botkit'); | |
const request = require('superagent'); | |
const controller = Botkit.slackbot(); | |
// Slack Bot starten; und unendlich viele Wieder-Verbindungen zulassen | |
controller.spawn({ | |
token: process.env.SLACK_BOT_TOKEN, | |
retry: Infinity, | |
}).startRTM(function (err, bot, payload) { | |
if (!err) return; |
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
# coding=utf-8 | |
from __future__ import print_function | |
from bs4 import BeautifulSoup | |
import re | |
import requests | |
from django.core.management.base import BaseCommand | |
from django.utils.encoding import force_text |
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.core.management.base import BaseCommand | |
from feincms.module.page.models import Page | |
class Command(BaseCommand): | |
def add_arguments(self, parser): | |
parser.add_argument('from_pk', type=int) | |
parser.add_argument('to_language', type=str) |
OlderNewer