Browse files

added setup and stuff

  • Loading branch information...
1 parent d430ac6 commit 3e95630f1e5faffa4a789db4814220f6717e45a7 @stefanfoulis committed Jan 6, 2010
Showing with 60 additions and 4 deletions.
  1. +1 −0 HISTORY
  2. +1 −0 README
  3. +51 −0 setup.py
  4. +7 −4 widgetry/views.py
View
1 HISTORY
@@ -0,0 +1 @@
+none yet
View
1 README
@@ -0,0 +1 @@
+initial README
View
51 setup.py
@@ -0,0 +1,51 @@
+APP_NAME = 'widgetry'
+DESCRIPTION = "An experimental set of widgets for django admin"
+
+from setuptools import setup, find_packages
+import os
+
+version = __import__(APP_NAME).__version__
+
+media_files = []
+for dir in ['%s/media' % APP_NAME,'%s/templates' % APP_NAME]:
+ for dirpath, dirnames, filenames in os.walk(dir):
+ media_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
+
+def read(fname):
+ # read the contents of a text file
+ return open(os.path.join(os.path.dirname(__file__), fname)).read()
+
+install_requires = [
+
+]
+
+setup(
+ name = "django-%s" % APP_NAME,
+ version = version,
+ url = 'http://github.com/stefanfoulis/django-%s' % APP_NAME,
+ license = 'BSD',
+ platforms=['OS Independent'],
+ description = DESCRIPTION,
+ long_description = read('README'),
+ author = 'Stefan Foulis',
+ author_email = 'stefan@foulis.ch',
+ packages=find_packages(exclude=['ez_setup']),
+ install_requires = install_requires,
+ package_data={
+ '': ['*.txt', '*.rst',],
+ },
+ package_dir = {
+ APP_NAME:APP_NAME,
+ },
+ data_files = media_files,
+ zip_safe=False,
+ classifiers = [
+ 'Development Status :: 4 - Beta',
+ 'Framework :: Django',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: BSD License',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',
+ 'Topic :: Internet :: WWW/HTTP',
+ ]
+)
View
11 widgetry/views.py
@@ -67,10 +67,13 @@ def __call__(self, request, query_param='q'):
field_qs[field_name] = smart_str(bit)
or_queries.append(Q(**field_qs))
#print field_qs
- other_qs = QuerySet(Model)
- other_qs.dup_select_related(qs)
- other_qs = other_qs.filter(reduce(operator.or_, or_queries))
- qs = qs & other_qs
+ #other_qs = QuerySet(Model)
+ #other_qs.dup_select_related(qs)
+ #other_qs = other_qs.filter(reduce(operator.or_, or_queries))
+ #qs = qs & other_qs
+ # other approach
+ qs = qs.filter(reduce(operator.or_, or_queries))
+
qs = qs#[:limit]
print "QUERY:"
print qs

0 comments on commit 3e95630

Please sign in to comment.