Skip to content

Instantly share code, notes, and snippets.

View matthiask's full-sized avatar
🥳

Matthias Kestenholz matthiask

🥳
View GitHub Profile
### 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:
@matthiask
matthiask / gist:7706022
Created November 29, 2013 13:55
Django management command for creating a big, FeinCMS page tree.
# ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
from __future__ import print_function
from django.core.management.base import NoArgsCommand
from feincms.module.page.models import Page
@matthiask
matthiask / gist:5175744
Created March 16, 2013 09:53
Product admin using specifications
class ProductAdmin(TranslationAdmin):
list_filter = ['is_active', 'categories', 'specification', 'upgrades']
filter_horizontal = ['upgrades', 'categories', 'matching_products']
form = FormWithSpecification
inlines = [
PriceInline,
SpecialPriceInline,
EducationPriceInline,
ProductImageInline,
]
@matthiask
matthiask / gist:1834813
Created February 15, 2012 09:42
Plata: Working Shop class with custom Contact model
class BaseCheckoutForm(forms.ModelForm):
"""
Needs self.request
"""
def clean(self):
data = self.cleaned_data
email = data.get('email')
create_account = data.get('create_account')
@matthiask
matthiask / gist:1606195
Created January 13, 2012 13:34
Staggered pricing scheme using Plata master
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"""