Using force_text for indexing message #746

Merged
merged 2 commits into from Mar 26, 2013

Conversation

Projects
None yet
3 participants
Contributor

lazerscience commented Feb 27, 2013

verbose_name_plural can be a functional proxy object as it is possible to use ugettext_lazy for it, if you wouldn't use force_text, the output would be:

All documents removed.
Indexing 203 <django.utils.functional.__proxy__ object at 0x30aed10>.
Indexing 19 <django.utils.functional.__proxy__ object at 0x30a1a50>.
Indexing 999 <django.utils.functional.__proxy__ object at 0x332f650>.
@lazerscience lazerscience using force_text for indexing message.
verbose_name_plural may be a functional proxy object from ugettext_lazy,
it should be forced to be a string!
7d55f25
Contributor

jezdez commented Mar 3, 2013

force_text is the Django>1.4.5 version of force_unicode. Since the latter will be supported for a while and is the only available in older versions I suggest to use it instead.

@bigjust bigjust added a commit that referenced this pull request Mar 26, 2013

@bigjust bigjust Merge pull request #746 from lazerscience/fix-update-index-output
Using force_text for indexing message
0e8bd20

@bigjust bigjust merged commit 0e8bd20 into django-haystack:master Mar 26, 2013

@floppya floppya added a commit to floppya/django-haystack that referenced this pull request Mar 29, 2013

@lazerscience @floppya lazerscience + floppya replacing `force_text` with `force_unicode`. #746 4caaefd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment