Re: how to create a faceted browser with Django

2009-11-11 Thread SeanB

Daniel:

I greatly appreciate the suggestion: it seems like it might offer just
what i'm looking for. But i'm having a bit of trouble getting things
set up (the dreaded "no results" on my simple test case, which means
i'm still missing something).

Do you happen to have a pointer to a running site that i can compare
to, so your end results can encourage me to persevere?

Sean

On Nov 9, 9:18 am, Daniel Roseman  wrote:
> On Nov 9, 4:24 am, SeanB  wrote:
>
>
>
> > Many web sites offer faceted browsing such that a series of categories
> > can be selected to narrow a large set of records down to a few (or
> > one). Such interfaces often show how many records match the various
> > category values, which sometimes helps direct the search. Likewise,
> > since only valid combinations of categories values are shown and
> > selectable, the problem problem of constraints with zero results are
> > mitigated. You can see this in action on lots of shopping sites:
> > Amazon's page on diamond wedding rings (http://www.amazon.com/gp/
> > search/ref=sr_nr_n_2?rh=n%3A3367581%2Ck%3Adiamonds%2Cn%3A!3880591%2Cn
> > %3A3887251&bbn=3880591&keywords=diamonds&ie=UTF8&qid=1257740168&rnid=388059 
> > 1)
> > is a good example.
>
> > I'm an intermediate-level Django user, and i'm trying to conceive how
> > to architect a faceted browsing application in Django. I can see
> > conceptually how a combination of constraints specified in the
> > interface could translate into a series of filter statements on a
> > model, and i can see how, with some constraints in place, the
> > remaining values and the number of records matching them could be
> > computed and presented.
>
> > But I'm less sure how to provide a RESTful interface (since any of
> > several constraints can be selected independently) in an efficient
> > manner, or how to work out the template details. So i'm looking for
> > some direction.
>
> > Are there any Django sites out there already that use an approach like
> > this? Or suggestions as to how to architect one?
>
> We've achieved faceted search by using the haystack project, which
> provides faceted search for Django out of the box in conjunction with
> an external search engine, Solr. Works well for us.
> --
> DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to create a faceted browser with Django

2009-11-09 Thread SeanB

as a follow-up: list_filter attributes in the admin interface provide
part of what i mean, but only part. Given a set of restrictions, the
admin interface:
* shows all possible choices, rather than the only remaining choices
that are possible
* doesn't show counts

Sean

On Nov 8, 8:24 pm, SeanB  wrote:
> Many web sites offer faceted browsing such that a series of categories
> can be selected to narrow a large set of records down to a few (or
> one). Such interfaces often show how many records match the various
> category values, which sometimes helps direct the search. Likewise,
> since only valid combinations of categories values are shown and
> selectable, the problem problem of constraints with zero results are
> mitigated. You can see this in action on lots of shopping sites:
> Amazon's page on diamond wedding rings (http://www.amazon.com/gp/
> search/ref=sr_nr_n_2?rh=n%3A3367581%2Ck%3Adiamonds%2Cn%3A!3880591%2Cn
> %3A3887251&bbn=3880591&keywords=diamonds&ie=UTF8&qid=1257740168&rnid=3880591)
> is a good example.
>
> I'm an intermediate-level Django user, and i'm trying to conceive how
> to architect a faceted browsing application in Django. I can see
> conceptually how a combination of constraints specified in the
> interface could translate into a series of filter statements on a
> model, and i can see how, with some constraints in place, the
> remaining values and the number of records matching them could be
> computed and presented.
>
> But I'm less sure how to provide a RESTful interface (since any of
> several constraints can be selected independently) in an efficient
> manner, or how to work out the template details. So i'm looking for
> some direction.
>
> Are there any Django sites out there already that use an approach like
> this? Or suggestions as to how to architect one?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



how to create a faceted browser with Django

2009-11-08 Thread SeanB

Many web sites offer faceted browsing such that a series of categories
can be selected to narrow a large set of records down to a few (or
one). Such interfaces often show how many records match the various
category values, which sometimes helps direct the search. Likewise,
since only valid combinations of categories values are shown and
selectable, the problem problem of constraints with zero results are
mitigated. You can see this in action on lots of shopping sites:
Amazon's page on diamond wedding rings (http://www.amazon.com/gp/
search/ref=sr_nr_n_2?rh=n%3A3367581%2Ck%3Adiamonds%2Cn%3A!3880591%2Cn
%3A3887251&bbn=3880591&keywords=diamonds&ie=UTF8&qid=1257740168&rnid=3880591)
is a good example.

I'm an intermediate-level Django user, and i'm trying to conceive how
to architect a faceted browsing application in Django. I can see
conceptually how a combination of constraints specified in the
interface could translate into a series of filter statements on a
model, and i can see how, with some constraints in place, the
remaining values and the number of records matching them could be
computed and presented.

But I'm less sure how to provide a RESTful interface (since any of
several constraints can be selected independently) in an efficient
manner, or how to work out the template details. So i'm looking for
some direction.

Are there any Django sites out there already that use an approach like
this? Or suggestions as to how to architect one?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: OperationalError 1366 Incorrect string value ... for column 'message'

2009-02-23 Thread SeanB

Bingo, that was precisely the problem: altering the message field to
use utf8_general_ci solved it. Thanks, i was really pulling my hair
out over this one!

Sean

On Feb 20, 5:18 pm, Karen Tracey  wrote:
> On Fri, Feb 20, 2009 at 8:00 PM, SeanB  wrote:
>
> > I have an application that include Unicode strings (Greek and Hebrew),
> > running on a dev machine and an (inside the firewall) release machine
> > configured (to the best of my ability) with the same Python, Django,
> > MySql and connector.
>
> > When editing an object containing one of these strings on the release
> > machine, in the admin interface, when i save i get:
> > OperationalError at /admin/realia/lemmarelation/1597/
>
> > (1366, "Incorrect string value: '\\xE1\\xBC\\x80\\xCE\\xAE\\xCF...'
> > for column 'message' at row 1")
>
> > Request Method:         POST
> > Request URL:    http://debuild/admin/realia/lemmarelation/1597/
> > Exception Type:         OperationalError
> > Exception Value:
>
> > (1366, "Incorrect string value: '\\xE1\\xBC\\x80\\xCE\\xAE\\xCF...'
> > for column 'message' at row 1")
>
> > [snip]
>
> > 'message' isn't in my model, so it's breaking somewhere in the Django
> > part, but i'm not sure why, or how to fix it. And i can't find
> > anything different about my two environments that explains why it
> > breaks on one machine, but works fine on the other. What seems like
> > the likely culprit is a UTF-8 string, whose collating method is
> > utf8_general_ci. It's not a single data value: attempting to edit any
> > object in this table seems to raise this error.
>
> Check the auth_message table definition (output of create table in mysql) on
> the machine that works vs. the one that fails.  It sounds like on the
> failing machine this table may have a default latin1 charset instead of
> utf8, so whenever the Django admin code attempts to insert a message (e.g.
> "XYZ was changed, you may edit it again below") that refers to an object
> where "XYZ" is going to contain chars not representable in latin1, you get
> an error.
>
> Karen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



OperationalError 1366 Incorrect string value ... for column 'message'

2009-02-20 Thread SeanB

I have an application that include Unicode strings (Greek and Hebrew),
running on a dev machine and an (inside the firewall) release machine
configured (to the best of my ability) with the same Python, Django,
MySql and connector.

When editing an object containing one of these strings on the release
machine, in the admin interface, when i save i get:
OperationalError at /admin/realia/lemmarelation/1597/

(1366, "Incorrect string value: '\\xE1\\xBC\\x80\\xCE\\xAE\\xCF...'
for column 'message' at row 1")

Request Method: POST
Request URL:http://debuild/admin/realia/lemmarelation/1597/
Exception Type: OperationalError
Exception Value:

(1366, "Incorrect string value: '\\xE1\\xBC\\x80\\xCE\\xAE\\xCF...'
for column 'message' at row 1")

Exception Location: C:\Python24\Lib\site-packages\MySQLdb
\connections.py in defaulterrorhandler, line 35
Python Executable:  C:\Program Files\Apache Software Foundation
\Apache2.2\bin\httpd.exe
Python Version: 2.4.3
Python Path:['c:/design.ed/django/logos/', 'C:\\Python24\\lib\\site-
packages\\setuptools-0.6c6-py2.4.egg', 'C:\\Python24\\Lib\\site-
packages\\django', 'C:\\design.ed\\django', 'C:\\Program Files\\Apache
Software Foundation\\Apache2.2', 'C:\\WINDOWS\\system32\
\python24.zip', 'c:\\python24\\lib\\site-packages', 'C:\\Python24\
\Lib', 'C:\\Python24\\DLLs', 'C:\\Python24\\Lib\\lib-tk', 'C:\\Program
Files\\Apache Software Foundation\\Apache2.2\\bin', 'C:\\Python24', 'c:
\\design.ed\\python\\libronix', 'C:\\Python24\\lib\\site-packages\
\win32', 'C:\\Python24\\lib\\site-packages\\win32\\lib', 'C:\\Python24\
\lib\\site-packages\\Pythonwin']
Server time:Fri, 20 Feb 2009 16:51:59 -0800

'message' isn't in my model, so it's breaking somewhere in the Django
part, but i'm not sure why, or how to fix it. And i can't find
anything different about my two environments that explains why it
breaks on one machine, but works fine on the other. What seems like
the likely culprit is a UTF-8 string, whose collating method is
utf8_general_ci. It's not a single data value: attempting to edit any
object in this table seems to raise this error.

Here's the traceback:
Environment:

Request Method: POST
Request URL: http://debuild/admin/realia/lemmarelation/1597/
Django Version: 1.0.2 final
Python Version: 2.4.3
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'logos.lcv',
 'logos.places',
 'logos.names',
 'logos.agents',
 'logos.realia']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware')


Traceback:
File "C:\Python24\Lib\site-packages\django\core\handlers\base.py" in
get_response
  86. response = callback(request, *callback_args,
**callback_kwargs)
File "C:\Python24\Lib\site-packages\django\contrib\admin\sites.py" in
root
  157. return self.model_page(request, *url.split('/',
2))
File "C:\Python24\Lib\site-packages\django\views\decorators\cache.py"
in _wrapped_view_func
  44. response = view_func(request, *args, **kwargs)
File "C:\Python24\Lib\site-packages\django\contrib\admin\sites.py" in
model_page
  176. return admin_obj(request, rest_of_url)
File "C:\Python24\Lib\site-packages\django\contrib\admin\options.py"
in __call__
  197. return self.change_view(request, unquote(url))
File "C:\Python24\Lib\site-packages\django\db\transaction.py" in
_commit_on_success
  238. res = func(*args, **kw)
File "C:\Python24\Lib\site-packages\django\contrib\admin\options.py"
in change_view
  587. return self.response_change(request,
new_object)
File "C:\Python24\Lib\site-packages\django\contrib\admin\options.py"
in response_change
  454. self.message_user(request, msg + ' ' + _("You may
edit it again below."))
File "C:\Python24\Lib\site-packages\django\contrib\admin\options.py"
in message_user
  363. request.user.message_set.create(message=message)
File "C:\Python24\Lib\site-packages\django\db\models\fields
\related.py" in create
  310. return super(RelatedManager, self).create
(**kwargs)
File "C:\Python24\Lib\site-packages\django\db\models\manager.py" in
create
  99. return self.get_query_set().create(**kwargs)
File "C:\Python24\Lib\site-packages\django\db\models\query.py" in
create
  319. obj.save(force_insert=True)
File "C:\Python24\Lib\site-packages\django\db\models\base.py" in save
  311. self.save_base(force_insert=force_insert,
force_update=force_update)
File "C:\Python24\Lib\site-packages\django\db\models\base.py" in
save_base
  383. result = manager._insert(values,
return_id=update_pk)
File "C:\Python24\Lib\site-packages\django\db\models\manager.py" in
_insert
  138. return insert_query(self.model,