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
ERROR: test_21_copy_content (feincms.tests.PagesTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "../feincms/tests/__init__.py", line 840, in test_21_copy_content | |
self.assertEqual(len(page2.content.main), 1) | |
File "../feincms/models.py", line 566, in __getattr__ | |
contents = collect_items(item) | |
File "../feincms/models.py", line 556, in collect_items | |
contents = obj._content_for_region(region) | |
File "../feincms/models.py", line 257, in _content_for_region |
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 feincms.models import ContentProxy | |
>>> from copy import deepcopy | |
>>> from feincms.module.page.models import Page | |
>>> p=Page.objects.all()[0] | |
>>> cp=ContentProxy(p) | |
>>> deepcopy(cp) | |
------------------------------------------------------------ | |
Traceback (most recent call last): | |
File "<ipython console>", line 1, in <module> | |
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/copy.py", line 188, in deepcopy |
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/feincms/admin/tree_editor.py b/feincms/admin/tree_editor.py | |
index d3e040b..65e6a2a 100644 | |
--- a/feincms/admin/tree_editor.py | |
+++ b/feincms/admin/tree_editor.py | |
@@ -235,7 +235,7 @@ class TreeEditor(admin.ModelAdmin): | |
Handle an AJAX toggle_boolean request | |
""" | |
try: | |
- item_id = int(request.POST.get('item_id', None)) | |
+ item_id = int(requestsOST.get('item_id', None)) |
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 A(object): | |
def meth(self): | |
print "A" | |
super(A, self).meth() | |
class B(object): | |
def meth(self): | |
print "B" | |
class C(A, B): |
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
" swap 2 params in visual selection | |
" ie: fun(a(), b()) => fun(b(), a()) | |
:vnoremap <Leader>s :s/\%V\([^,]\+\)\(, *\)\(.*\%V.\)/\3\2\1<CR>gv<Esc>:noh<CR> |
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
# changing verbose name of model does not change ContentType name | |
# this script will loop through all ContentType objects and refresh names | |
# optional activate translation | |
from django.utils import translation | |
translation.activate('en') | |
from django.contrib.contenttypes.models import ContentType | |
content_types = ContentType.objects.all() |
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
jQuery.fn.equalHeight = function() { | |
var h = Math.max.apply(Math, this.map(function() {return $(this).height();}).get()); | |
this.height(h); | |
return this; | |
}; |
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.core.urlresolvers import reverse | |
from django.contrib.contenttypes.models import ContentType | |
def edit_link(field_name, short_description=None): | |
""" | |
Displays link to change form for foreign key object. | |
Use in `readonly_fields` or `list_display`:: |
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
# ...in models.py | |
from django.dispatch import receiver | |
from rosetta.signals import post_save | |
@receiver(post_save) | |
def restart_server(sender, **kwargs): | |
import os | |
os.system("sleep 1 && echo \"Rosetta reload\" && touch %s &" % __file__) |
OlderNewer