Skip to content

Instantly share code, notes, and snippets.

View justquick's full-sized avatar
⚙️
Contemplating the Infinite

Justin Quick justquick

⚙️
Contemplating the Infinite
View GitHub Profile
CALLOWAY_ROOT = os.path.abspath(os.path.dirname(calloway.__file__))
sys.path.insert(0, os.path.join(CALLOWAY_ROOT, 'apps'))
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'apps'))
sys.path.insert(0, os.path.join(PROJECT_ROOT, 'lib'))
./manage.py copy_static_media
Copying admin_tools's media to /static
Copying django.contrib.admin's media to /static
Copying stories's media to /static
Copying categories's media to /static
Copying editor's media to /static
Traceback (most recent call last):
File "./manage.py", line 17, in <module>
execute_manager(settings)
File "/Users/nakundent/.virtualenvs/scout-n-go/lib/python2.5/site-packages/django/core/management/__init__.py", line 438, in execute_manager
Environment:
Request Method: GET
Request URL: http://local.washingtontimes.com:8000/admin/
Django Version: 1.1.2
Python Version: 2.6.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
http:422
throw new Error("This type of response MUST NOT have a body.");
^
Error: This type of response MUST NOT have a body.
at ServerResponse.write (http:422:11)
at Object.handleError (/home/webdev/hummingbird/lib/hummingbird.js:113:9)
at Server.<anonymous> (/home/webdev/hummingbird/server.js:31:21)
at Server.emit (events:32:26)
at HTTPParser.onIncoming (http:815:10)
Environment:
Request Method: GET
Request URL: http://m.washingtontimes.com/news/2009/jun/15/walpin-gate/
Django Version: 1.1.1
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
('.py',
'.png',
'.css',
'.js',
'.txt',
'.htm',
'.gif',
'.html',
'.jpg',
Running setup.py install for critic
Found existing installation: distribute 0.6.10
Uninstalling distribute:
Successfully uninstalled distribute
Running setup.py install for distribute
Before install bootstrap.
Scanning installed packages
Setuptools installation detected at /Users/jquick/.virtualenvs/cal/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
Egg installation
Patching...
Traceback (most recent call last):
File "setup.py", line 37, in <module>
'Topic :: Software Development :: Libraries :: Python Modules',
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "build/bdist.linux-i686/egg/setuptools/command/install.py", line 76, in run
In [1]: from ellington.categories.models import Category
In [2]: Category
Out[2]: <class 'ellington.categories.models.Category'>
In [3]: dir(Category)
Out[3]:
['DoesNotExist',
'MultipleObjectsReturned',
'__class__',
def latest_objects_by_category(category, app_label, model_name, set_name, date_field='pub_date'):
from django.db.models import get_model
from categories import registry
from categories.models import Category
if isinstance(category, basestring):
category = Category.objects.get(slug=category)
m = get_model(app_label, model_name)
fk = hasattr(category, 'primary_%s_set'%set_name) and getattr(category, 'primary_%s_set'%set_name).all() or set()
m2m = hasattr(category, '%s_set'%set_name) and getattr(category, '%s_set'%set_name).all() or set()
results = fk | m2m