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 next_birthdays(qs, days, fieldname): | |
def s(part, op, val): | |
return "EXTRACT(%s FROM %s) %s %s" % (part, fieldname, op, val) | |
now = date.today() | |
limit = now + timedelta(days=days) | |
lo_day = now.day | |
lo_month = now.month | |
hi_day = limit.day | |
hi_month = limit.month | |
if hi_day > lo_day: |
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
from datetime import date, timedelta | |
from django.db.models import Q | |
def next_birthdays(qs, days, fieldname): | |
def f(*args): | |
args = list(args) | |
last = args.pop(-1) | |
names = [fieldname] + args | |
return {'__'.join(names): last} | |
now = date.today() |
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
from django.utils import importlib | |
def lazy_listen(signal, reciever, sender=None): | |
if sender and isinstance(sender, basestring): | |
module, obj = sender.rsplit('.', 1) | |
mod = importlib.import_module(module) | |
sender = getattr(mod, obj) | |
signal.connect(reciever, sender=sender) |
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
Dreamer [Saito], level [1], priority [0], policy [OTHER] | |
Dreamer [Eames], level [1], priority [0], policy [OTHER] | |
Dreamer [Ariadne], level [1], priority [0], policy [OTHER] | |
Dreamer [Fischer], level [1], priority [0], policy [OTHER] | |
Dreamer [Yusuf], level [1], priority [0], policy [OTHER] | |
Dreamer [Arthur], level [1], priority [0], policy [OTHER] | |
Dreamer [Cobb], level [1], priority [0], policy [OTHER] | |
[Fischer] HIJACKED ! Open up my defense projections in my dream to the hijackers! | |
[Saito] sees Fischers defense projections at work in the dream at level [1] | |
[Saito] shot in level 1. Following Cobb to level 2 |
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
SELECT "django_site"."id", | |
"django_site"."domain", | |
"django_site"."name" | |
FROM "django_site" | |
WHERE "django_site"."id" = 1 ; | |
SELECT "cms_page"."id", | |
"cms_page"."publisher_is_draft", | |
"cms_page"."publisher_public_id", |
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
[buildout] | |
eggs-directory = /path/to/some/folder/ |
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
<html> | |
<head> | |
<script ... my global script></script> | |
{% render_pre_block myhead %} | |
other stuf | |
{% render_pre_block myhead2 %} | |
</head> | |
<body> | |
<div id="page"> | |
{% addtoblock myhead %} |
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
<html> | |
<head> | |
<script ... my global script></script> | |
{% renderblock myhead %} | |
other stuf | |
{% renderblock myhead2 %} | |
</head> | |
<body> | |
<div id="page"> | |
{% addtoblock myhead %} |
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 BaseView(object): | |
""" | |
A base class to create class based views. | |
It will automatically check allowed methods if a list of allowed methods are | |
given. It also automatically tries to route to 'handle_`method`' methods if | |
they're available. So if for example you define a 'handle_post' method and | |
the request method is 'POST', this one will be called instead of 'handle'. | |
""" | |
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
diff --git a/cms/tests/menu.py b/cms/tests/menu.py | |
index 3b7724b..76a5ee7 100644 | |
--- a/cms/tests/menu.py | |
+++ b/cms/tests/menu.py | |
@@ -34,6 +34,11 @@ class MenusTestCase(CMSTestCase): | |
self.page3 = self.create_page(parent_page=self.page2, published=True, in_navigation=True) | |
self.page4 = self.create_page(parent_page=None, published=True, in_navigation=True) | |
self.page5 = self.create_page(parent_page=self.page4, published=True, in_navigation=True) | |
+ self.page6 = self.create_page(parent_page=None, published=True, in_navigation=False) | |
+ self.page7 = self.create_page(parent_page=self.page6, published=True, in_navigation=True) |