I hereby claim:
- I am nimasmi on github.
- I am nimasmi (https://keybase.io/nimasmi) on keybase.
- I have a public key ASCIYTT_Z-NcSxohQ7JrWt1c54bo6vKaiNIydDcY8CvQxQo
To claim this, I am signing this object:
class TranslatedField(object): | |
def __init__(self, fieldname): | |
self.fieldname = fieldname | |
def get_translated_field(self, instance, language): | |
return getattr(instance, "_".join([self.fieldname, language])) | |
def __get__(self, instance, owner): | |
language = get_language() | |
translation = self.get_translated_field(instance, language) |
#!/bin/bash | |
NODE_VERSION=v4.2.3 # amend this line only, to change Node version | |
# Node.js | |
if ! command -v npm; then | |
INSTALL_NODE=1 | |
elif [ $NODE_VERSION != `node --version` ]; then | |
rm -rf /opt/node-`node --version`-linux-x64/ | |
rm /usr/local/bin/node |
from wagtail.wagtailcore.models import get_page_models | |
from wagtail.wagtailcore.utils import resolve_model_string | |
class SinglePageInstanceMixin(object): | |
@classmethod | |
def clean_parent_page_types(cls): | |
""" | |
Rewrite wagtailcore.models.Page.clean_parent_page_models to ensure that |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import json | |
from django.core.serializers.json import DjangoJSONEncoder | |
from django.db import migrations, models | |
from wagtail.wagtailcore.rich_text import RichText |
I hereby claim:
To claim this, I am signing this object:
from django.utils.timezone import now | |
from dateutil.rrule import MONTHLY, rrule | |
def get_start_date_choices(): | |
today = now().date() | |
choices = [(today, "Now")] | |
for start_date in rrule(MONTHLY, count=12, dtstart=today, | |
bymonthday=1): |
I've been aware for a couple of years now that there are only really 11 colours. In my experience, this feels like a boy/girl distinction.
Let me explain: most colours that girls talk about are in fact just different names for the same thing (Death Cab for Cutie reference intended). For example: 'teal'. What's that if it's not a shade of green?
I will reveal what these colours are shortly, but before that, let me tell you why we have to stop somewhere—why we shouldn't go the whole hog and pare it down to just three, red, green and blue. Although you can describe most colours humans can see with just an RGB value, everyday experience necessitates a wider vocabulary, particularly in the surprisingly different subjective appearance of yellow from its red and green constituent primaries.
Starting with the rainbow then, we see that there is
This is just a place to host builds of Wagtail on the in-development i18n-combined branch, and wagtail-localize on the beta branch.
This largely follows the CI process nightly-build
at https://github.com/wagtail/wagtail/blob/7eeb44ad0408cf72060f19db577de2159859cd74/.circleci/config.yml#L49
git clone git@github.com:kaedroho/wagtail.git wagtail
cd wagtail
from django.views.generic import FormView | |
from django.utils.translation import ugettext_lazy as _ | |
from django.contrib import messages | |
from import_export.formats import base_formats | |
from import_export.forms import ImportForm, ConfirmImportForm | |
from import_export.resources import modelresource_factory | |
from django.http import HttpResponseRedirect | |
from import_export.tmp_storages import TempFolderStorage | |
try: |