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
#!/usr/bin/env python | |
# coding: utf-8 | |
""" | |
based in http://www.djangosnippets.org/snippets/1044/ | |
""" | |
import os | |
BASE_PATH = os.path.abspath(os.path.dirname(__file__)) |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
""" | |
based in http://www.djangosnippets.org/snippets/1044/ | |
""" | |
import os | |
BASE_PATH = os.path.abspath(os.path.dirname(__file__)) |
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
# source line: | |
""" | |
"supplier" ManyToManyField: | |
new, would be renamed supplier -> not new anymore supplier | |
= always the same supplier | |
""" | |
# would be changed to: | |
""" |
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
... | |
posts = query.order_by(order) | |
if 'topics' in request.GET['show_as']: | |
print posts.count() # This is very fast | |
# seems to be qual what using here to get all pk: | |
print "this is slow 1:" |
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
diff --git a/.gitignore b/.gitignore | |
new file mode 100644 | |
index 0000000..0ab606f | |
--- /dev/null | |
+++ b/.gitignore | |
@@ -0,0 +1,13 @@ | |
+*.py[co] | |
+*.egg-info | |
+.pydevproject | |
+.project |
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
diff --git a/djangobb_forum/views.py b/djangobb_forum/views.py | |
index c1772f3..8981d4b 100644 | |
--- a/djangobb_forum/views.py | |
+++ b/djangobb_forum/views.py | |
@@ -166,7 +166,8 @@ def search(request): | |
base_url = "?action=show_user&user_id=%s&show_as=" % user_id | |
if not show_as_posts: | |
# show as topic | |
- # FIXME: This should be speed up. This is not lazy: | |
+ # FIXME: This should be speed up. Same problem as below. |
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
import time | |
class SmoothCacheTime(int): | |
def __new__(cls, value=None): | |
if value is None: | |
value = time.time() | |
i = int.__new__(cls, value) | |
return i | |
i = SmoothCacheTime() |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
""" | |
http://wiki.python-forum.de/Plattform%20unterscheiden | |
""" | |
import os | |
import sys | |
import platform |
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
def test_clean_bbcode3(self): | |
post = Post.objects.create( | |
text=( | |
u'test äöüß' | |
), | |
bbcode_uid="1234abcd", | |
bbcode_bitfield="foo", | |
) | |
self.assertEqual(post.get_cleaned_bbcode(), | |
u'test äöüß' |
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
def test_clean_bbcode4(self): | |
post = Post.objects.create( | |
text=( | |
'test äöüß [url=https://github.com/jedie/PyLucid/views.py:1234abcd]/views.py[/url:1234abcd]' | |
), | |
bbcode_uid="1234abcd", | |
bbcode_bitfield="foo", | |
) | |
self.assertEqual(post.get_cleaned_bbcode(), | |
'test äöüß [url=https://github.com/jedie/PyLucid/views.py]/views.py[/url]' |