prakash09 / django-ajax-selects Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/django-ajax-selects
Automatically exported from code.google.com/p/django-ajax-selects
The template autocompleteselectmultiple.html uses array forEach, which is
not implemented in IE6. please use $.each instead
Original issue reported on code.google.com by [email protected]
on 5 May 2010 at 6:50
The following steps will reproduce the problem:
1. Activate an app with some models (e.g. Photologue)
2. Activate an autocomplete field with the possibility to add new objects
from within the autocomplete widget.
3. Change permissions on a particular user/role, removing permissions for
all the other models except for the one with the autocomplete widget (e.g.
user can add/change/delete photo, but user cannot add/change/delete Photo Size.
The user should be able to add new objects, but in the admin the add icon
is not displayed.
The problem seems related to the expression "%s.view_%s" in fields.py at
line 246, that probably should be set to "%s.add_%s".
Original issue reported on code.google.com by [email protected]
on 26 Apr 2010 at 5:42
Hello,
Could you give us an estimation of when you intent to release the first
version of your app, making it available through pypi and having a tarball?
Thank you
Original issue reported on code.google.com by [email protected]
on 9 Oct 2009 at 1:42
## Reproduce ##
1. Use the plus sign to add a new foreignkeyed entry
2. Press save in popup window.
## Result ##
It only shows the unicode result (e.g. title) below the textfield and not the
lookuped string from "format_item()".
## Summary ##
Is there any way to get it to show the same result than when using the search
function?
Original issue reported on code.google.com by [email protected]
on 24 Jun 2010 at 8:55
I'm a newbie on this, but maybe it could be better if in the admin.py use a
subclass of ModelAdmin to use this great tool, instead of the
make_ajax_form call.
Original issue reported on code.google.com by [email protected]
on 23 Feb 2010 at 12:37
diff -Naur old-django-ajax-selects-svnr24/ajax_select/views.py
django-ajax-selects-svnr24/ajax_select/views.py
--- old-django-ajax-selects-svnr24/ajax_select/views.py 2009-10-12
19:26:13.000000000 -0400
+++ django-ajax-selects-svnr24/ajax_select/views.py 2009-10-12
19:28:33.000000000 -0400
@@ -8,7 +8,7 @@
# it should come in as GET unless global $.ajaxSetup({type:"POST"})
has been set
# in which case we'll support POST
- query = request.GET['q'] if request.method == "GET" else request.POST['q']
+ query = request.GET['q'] and request.method == "GET" or request.POST['q']
lookup_channel = get_lookup(channel)
Original issue reported on code.google.com by [email protected]
on 12 Oct 2009 at 11:30
When there is no javascript support in the browser (because of group policy
or because using a limited device like a cellphone) it is impossible to
validate the form since the ids are stored in a hidden field.
This breakage of non javascript browsers is a serious limitation. I got
around this for the AutoCompleteSelectField with a small fix in the
template and widget.
I have attached the fix, feel free to include it.
Original issue reported on code.google.com by [email protected]
on 15 Jul 2009 at 7:45
Attachments:
Where is ajax_select.js ?
I don't find it anywhere.
Thanks
Pasquale
Original issue reported on code.google.com by [email protected]
on 6 Jun 2010 at 8:43
This is easily fixed in views.py by replace ¦ with |
Original issue reported on code.google.com by [email protected]
on 26 Aug 2010 at 4:48
I found inside template autocomplete.html replacement for avoiding js error
"missing ( before formal parameters", when fieldname have "-" symbol:
{{ html_id|cut:"-" }}
But other templates doesn't have this replacement. It's bug I think. This
patch solves this omission.
Original issue reported on code.google.com by [email protected]
on 29 May 2009 at 2:13
Attachments:
Just added a patch, which allows to run your project over Python 2.4.
Original issue reported on code.google.com by [email protected]
on 12 Oct 2009 at 11:35
Attachments:
What steps will reproduce the problem?
1. Create an AutoCompleteSelectField and specify widget in the arguments
2. Explosion: widget defined two times in the kwargs dictionary
> What is the expected output? What do you see instead?
Standard Django fields let users specify a custom widget. Doing so should
not throw an exception.
> What version of the product are you using? On what operating system?
A somewhat recent checkout of SVN (within the last month: july 2009, sorry,
checkout was not made by me)
> Please provide any additional information below.
Not being able to provide a custom widget blocks the ability to add attributes.
Patch to let users define a widget (forced to be a decendant of
AutoCompleteSelectWidget) provided as an attachment.
Original issue reported on code.google.com by [email protected]
on 21 Jul 2009 at 3:46
Attachments:
What steps will reproduce the problem?
I believe I followed your example... Minus the 'JS/CSS' compression steps..
What is the expected output? What do you see instead?
I'm expecting the dropdown to have the css 'iconic.css' applied but it
isn't working.. Looking at the output, the html doesn't contain any class
for the input 'iconic' to match against..... it's actually giving
class="text" which doesn't seem right... I'm sure I've probably made a
mistake somewhere.. But i'm not seeing it.
What version of the product are you using? On what operating system?
Lastest SVN of django-ajax-selects, (Arch Linux), apache-> mod_wsgi, python
2.6.2, jQuery plugin 1.0.2, jquery 1.3.2
Please provide any additional information below.
div class="form-row"><label for="id_client">Client</label>
<input type="text" name="client_text" id="id_client_text" value=""
size="40" class="text" maxlength="255" />
<p class="help">Enter text to search.</p><input type="hidden" name="client"
id="id_client" value="" />
<script type="text/javascript">
$(function(){
function formatItem_id_client(row) {
return row[2];
}
function formatResult_id_client(row) {
return row[1];
}
$("#id_client_text").autocomplete('/adnauseam/ajax/ajax_lookup/client', {
width: 320,
formatItem: formatItem_id_client,
formatResult: formatResult_id_client,
dataType: "text"
});
$("#id_client_text").result(function(event, data, formatted) {
$("#id_client").val(data[0]);
$("#id_client_text").val(data[1]);
});
$("#id_client_text").blur(function() {
if(! $("#id_client_text").val() ){
$("#id_client").val('');
}
});
});
</script>
Thanks for any direction to look/help...
Original issue reported on code.google.com by [email protected]
on 30 Jul 2009 at 7:44
Hi,
I use your ``django-ajax-selects`` in our project and really need to use
it not only for foreign keys. For example, for ``tags`` fields.
So, i added support for non-foreign keys to ``django-ajax-selects``.
Merge it to your repository if you appreciate.
Igor
Original issue reported on code.google.com by [email protected]
on 29 Apr 2009 at 11:26
Attachments:
In the wiki it suggests its possible to perform a permissions check when
using a lookup class.
I wasn't able to find a graceful way of returning a 403 (I tried decorators
etc...) so I am submitting this simple patch.
Basically, if someone defines a is_authenticated method in their lookup
object it will be called and if the result is false then a 403 will be
returned.
As detailed in http://docs.jquery.com/Ajax/jQuery.ajax#toptions jquery can
be configured to do something if it receives a 403, thus the method should
not need to return anything.
If there is a better way can you please document it in the wiki?
Thanks
Alex
Original issue reported on code.google.com by alex%[email protected]
on 25 Oct 2009 at 10:37
Attachments:
It would be nice to have a link showing django-ajax-selects working.
Original issue reported on code.google.com by [email protected]
on 2 Mar 2009 at 3:57
What steps will reproduce the problem?
1. Install using easy_install or the git repo
2. http://127.0.0.1:8000/admin/artists/artist/ works
http://127.0.0.1:8000/admin/artists/artist/add/ throws the error
3.
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/artists/artist/add/
Django Version: 1.2.1
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'reversion',
'gatekeeper',
.. here i put my custom apps ..
'ajax_select']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Template error:
In template
/media/myhd/Projects/myproject/templates/admin/includes/fieldset.html, error at
line 18
Caught AttributeError while rendering: 'NoneType' object has no attribute 'objects'
8 : {{ line.errors }}
9 : {% for field in line %}
10 : <div{% if not line.fields|length_is:"1" %} class="field-box"{% endif %}>
11 : {% if field.is_checkbox %}
12 : {{ field.field }}{{ field.label_tag }}
13 : {% else %}
14 : {{ field.label_tag }}
15 : {% if field.is_readonly %}
16 : <p>{{ field.contents }}</p>
17 : {% else %}
18 : {{ field.field }}
19 : {% endif %}
20 : {% endif %}
21 : {% if field.field.field.help_text %}
22 : <p class="help">{{ field.field.field.help_text|safe }}</p>
23 : {% endif %}
24 : </div>
25 : {% endfor %}
26 : </div>
27 : {% endfor %}
28 : </fieldset>
Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in
get_response
100. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py"
in wrapper
239. return self.admin_site.admin_view(view)(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in
_wrapped_view
76. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py"
in _wrapped_view_func
69. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in
inner
190. return view(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py" in
_commit_on_success
299. res = func(*args, **kw)
File
"/usr/local/lib/python2.6/dist-packages/django_reversion-1.3.1-py2.6.egg/reversi
on/revisions.py" in _create_on_success
321. result = func(*args, **kwargs)
File
"/usr/local/lib/python2.6/dist-packages/django_reversion-1.3.1-py2.6.egg/reversi
on/admin.py" in add_view
292. return super(VersionAdmin, self).add_view(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in
_wrapper
21. return decorator(bound_func)(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in
_wrapped_view
76. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in
bound_func
17. return func(self, *args2, **kwargs2)
File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py" in
_commit_on_success
299. res = func(*args, **kw)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py"
in add_view
851. return self.render_change_form(request, context, form_url=form_url, add=True)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py"
in render_change_form
634. ], context, context_instance=context_instance)
File "/usr/local/lib/python2.6/dist-packages/django/shortcuts/__init__.py" in
render_to_response
20. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in
render_to_string
186. return t.render(context_instance)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
173. return self._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
167. return self.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py" in
render
125. return compiled_parent._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
167. return self.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py" in
render
125. return compiled_parent._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
167. return self.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py" in
render
62. result = block.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py" in
render
167. nodelist.append(node.render(context))
File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py" in
render
139. return self.template.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
173. return self._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
167. return self.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py" in
render
167. nodelist.append(node.render(context))
File "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py" in
render
167. nodelist.append(node.render(context))
File "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py" in
render
253. return self.nodelist_false.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py" in
render
253. return self.nodelist_false.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render
91. output = force_unicode(output)
File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py" in
force_unicode
66. s = unicode(s)
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in
__unicode__
408. return self.as_widget()
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in as_widget
446. return widget.render(name, data, attrs=attrs)
File "/usr/local/lib/python2.6/dist-packages/ajax_select/fields.py" in render
137. objects = lookup.get_objects(value)
File "/usr/local/lib/python2.6/dist-packages/ajax_select/__init__.py" in
get_objects
154. return model.objects.filter(pk__in=ids).order_by(search_field)
Exception Type: TemplateSyntaxError at /admin/artists/artist/add/
Exception Value: Caught AttributeError while rendering: 'NoneType' object has
no attribute 'objects'
i'm goin crazy.. :S
Original issue reported on code.google.com by [email protected]
on 9 Aug 2010 at 11:07
Perhaps django-ajax-selects could be even better by supporting javascript
callbacks to let others extend the existing functionality. I will attach a
short patch so show this.
As an alternative it would be very helpful to define some blocks inside the
existing templates to support adding thing in there without having to copy
the whole file. I have attached a patch for this, too.
Original issue reported on code.google.com by [email protected]
on 27 May 2009 at 11:07
Attachments:
I put together some hacks and abstracted a few functions to allow inlines to
work and dynamically add more items. This is tricky since Django creates the
first form with __prefix__ in the field id and then replaces this with a number
when another inline is added. The problem is the ajax-select functions are
already created with the __prefix__ name hardcoded... So I moved all those
functions into the global ajax_select.js and the bit in the template now calls
that function with the corrected id and url. Hacky but it works.
Attaching the files in case anyone wants this functionality. I can't remember
if there's anything else needed to make this work, but it should be fine. I
didn't make the change for the autocomplete.html since I'm not using it, but
this should get you started.
Original issue reported on code.google.com by [email protected]
on 26 Aug 2010 at 4:54
Attachments:
What steps will reproduce the problem?
1. Write a custom search channel object with different return values for
format_result and format_item.
2. Create an autocomplete field specifying the previous channel.
3. Provide a default value to the field (or submit an invalid form
containing it).
What is the expected output? What do you see instead?
The expected output is the value returned by lookup.format_item.
I see the value returned by lookup.format_result.
What version of the product are you using? On what operating system?
svn r30 (2010 May 7) on Ubuntu with Django 1.2 RC1.
Please provide any additional information below.
Here's a simple patch that fix this issue.
--- fields.py (revisiรณn: 30)
+++ fields.py (copia de trabajo)
@@ -32,7 +32,7 @@
lookup = get_lookup(self.channel)
if value:
- current_result = mark_safe(lookup.format_result(
lookup.get_objects([value])[0] ))
+ current_result = mark_safe(lookup.format_item(
lookup.get_objects([value])[0] ))
else:
current_result = ''
Original issue reported on code.google.com by [email protected]
on 7 May 2010 at 1:52
When converting to django ajax selects, we had a lot of unittests that
relied on the POST syntax for a standard multiselect. Instead of changing
500+ unittests, it would be nice to have the
AutoCompleteSelectMultipleWidget allow both the standard and the jQuery
autocomplete pipe-style syntax.
Patch attached.
Original issue reported on code.google.com by [email protected]
on 3 May 2010 at 8:17
Attachments:
Hi,
The jquery-plugin-autocomplete is deprecated, you can see here [0].
So, django-ajax-selects should depends on jquery-ui, instead.
[0] http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete
Cheers
Original issue reported on code.google.com by [email protected]
on 2 Aug 2010 at 3:51
Please consider applying the attached patch. It renames all references of
id to pk, and will work even if the primary key is not called id.
Thanks.
Original issue reported on code.google.com by [email protected]
on 7 Aug 2009 at 12:37
Attachments:
The widget doesn't show the related objects on a ManyToManyField('self'...
field type
Original issue reported on code.google.com by [email protected]
on 23 Feb 2010 at 3:31
I'm struggling to get this to work (or any Django admin stuff) on the
related_name end of a many-to-one relationship as detailed at
http://stackoverflow.com/questions/1691299/canm-django-admin-handle-a-one-to-man
y-relationship-via-relatedname
Should it be possible? How?
Original issue reported on code.google.com by [email protected]
on 7 Nov 2009 at 12:00
The following patch will trigger a "killed" event whenever an item in a
multiple select list is killed. This makes it easier to update other page
elements that rely on the selected list:
=== modified file 'apps/ajax_select/templates/autocompleteselectmultiple.html'
--- apps/ajax_select/templates/autocompleteselectmultiple.html 2009-06-12
23:53:31 +0000
+++ apps/ajax_select/templates/autocompleteselectmultiple.html 2009-06-30
20:26:32 +0000
@@ -34,7 +34,10 @@
function addKiller_{{html_id}}(repr,id) {
kill = "<span class='iconic' id='kill_" + id + "'>X</span> ";
$( "#{{html_id}}_on_deck" ).append("<div id='{{html_id}}_on_deck_" + id
+"'>" + kill + repr + " </div>");
- $("#kill_"+id).click(function(num) { return
function(){kill_{{html_id}}(num)}}(id) );
+ $("#kill_"+id).click(function(num) { return function(){
+ $("#{{html_id}}_on_deck").trigger("killed");
+ kill_{{html_id}}(num);
+ }}(id) );
}
function kill_{{html_id}}(id) {
$("#{{html_id}}").val( $("#{{html_id}}").val().replace( "|" + id + "|",
"|" ) );
@@ -45,4 +48,4 @@
addKiller_{{html_id}}(its[0],its[1]);
});
});
Original issue reported on code.google.com by [email protected]
on 30 Jun 2009 at 8:30
Hello,
I am interested in packaging this software for Debian.
Unfortunately I cannot see any copyright or licensing information in the
downloaded source file.
Debian requires a copyright statement in the form of, e.g.
Copyright (C) YYYY Name
What values should I put for year and copyright holder?
Also there is no license included in the file, however the website says it is
licensed per the MIT license - can I confirm this is correct?
Thanks
Original issue reported on code.google.com by [email protected]
on 19 Jul 2010 at 8:38
Please add media folder with js and css files required for this to work.
Or please at least put links where to get them into README and app description.
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ is abandoned,
and the last version is 1.1.
I'd like to know if it's compatible or not, if jquery ui autocomplete should
now be used, or if it can't be used.
Original issue reported on code.google.com by [email protected]
on 9 Jul 2010 at 5:32
Hi, this just became an super needed feature. Do you think you could give any
pointer on how it could be implemented?
Original issue reported on code.google.com by [email protected]
on 10 Aug 2010 at 6:57
make AutoCompleteSelectField operate the same way that
AutoCompleteSelectMultipleField does.
after selection, add a display of that item below (with a removal X)
and it would be nicer as that would acknowledge the user's selection
Original issue reported on code.google.com by [email protected]
on 21 Jul 2009 at 6:50
Please add a blank models.py to the ajax_select folder, so that the app can
be found by autodiscovery.
Original issue reported on code.google.com by [email protected]
on 22 Jan 2010 at 11:06
It would be nice to use pip or easy_install for this.
Would you mind including a setup.py?
Thanks,
Igor
Original issue reported on code.google.com by [email protected]
on 29 May 2009 at 2:28
What steps will reproduce the problem?
1. Install django-trunk
2. Create autocomplete fields as usual
3. Open add/change views in admin
What is the expected output? What do you see instead?
IE stops executing JavaScript at
currentRepr = new Array();
currentRepr.forEach(function(its){
addKiller_subjects(its[0],its[1]);
});
because IE hasn't implemented forEach method for arrays.
What version of the product are you using? On what operating system?
Internet Explorer 8 on Windows 7
Please provide any additional information below.
Can be fixed by including this snippet of javascript before
executing .forEach:
//For compability with InternetExplorer
if (!Array.prototype.forEach)
{
Array.prototype.forEach = function(fun /*, thisp*/)
{
var len = this.length;
if (typeof fun != "function")
throw new TypeError();
var thisp = arguments[1];
for (var i = 0; i < len; i++)
{
if (i in this)
fun.call(thisp, this[i], i, this);
}
};
}
Original issue reported on code.google.com by [email protected]
on 10 Apr 2010 at 3:23
See <http://docs.djangoproject.com/en/dev/topics/forms/media/>. This means
there is no need have hard coded references these files from the templates
or forms.
eg.
class AutoCompleteSelectWidget(forms.widgets.TextInput):
""" widget to select a model """
class Media:
css = {
'all': ( 'css/jquery.autocomplete.css', )
}
js = ('js/jquery.js','js/jquery.autocomplete.js',)
...
class AutoCompleteWidget(forms.TextInput):
"""
Widget to select a search result and enter the result as raw text in
the text input field.
the user may also simply enter text and ignore any auto complete
suggestions.
"""
class Media:
css = {
'all': ( 'css/jquery.autocomplete.css', )
}
js = ('js/jquery.js','js/jquery.autocomplete.js',)
...
Original issue reported on code.google.com by [email protected]
on 7 Aug 2009 at 12:58
What steps will reproduce the problem?
1. Add url(r'^ajax-select/', include('ajax_select.urls'))
2. Hit one of your channels manually in your browser, i.e.
/ajax-select/ajax_lookup/student-university
This returns a 500 Server Error, failing on this line:
Traceback (most recent call last):
...
File "\django-ajax-selects\ajax_select\views.py", line 11, in ajax_lookup
query = request.GET['q'] if request.method == "GET" else request.POST['q']
...
Maybe this should just return an empty HttpResponse? For example:
if not request.is_ajax():
return HttpResponse('')
or
if 'q' not in request.REQUEST:
return HttpResponse('')
Original issue reported on code.google.com by [email protected]
on 22 Oct 2009 at 5:59
What steps will reproduce the problem?
1. Display unbound form with an AutoCompleteSelectField
2. Enter value in field.
3. Submit form. Field works as expected.
4. Click back button.
5. Observe that field is empty.
6. With firebug observe that hidden field is not empty, and still contains
the same pk value as before.
7. Submit form. Same values are submitted as last time, although the field
looked like it was empty, to the user.
What is the expected output? What do you see instead?
When clicking the back button, the field should still contain the value
from before. It should not be empty.
What version of the product are you using? On what operating system?
This is subversion version 15, although have had the same problem with
version 8.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 7 Aug 2009 at 1:09
It's a one line change that will make this django app compatible with python
2.4.
It's only change this file in fields.py:
'help_text':self.help_text if self.show_help_text else '',
To this other:
'help_text':self.show_help_text and self.help_text or '',
Original issue reported on code.google.com by [email protected]
on 8 Jul 2010 at 4:32
I'm using django-ajax-selects primarily in my user facing site, not the
admin, and it would be really nice to leverage the templates that wrap up
the jquery calls and fields so that they can be used as a template tag.
Attached is a patch that allows this.
In your template you can use:
{{{
{% load ajax_select %}
{% autocompleteselect_field 'channel' 'name' 'current_name'
'current_id' 'help_text'%}
}}}
This will then use the autocompleteselect.html template to generate the
form element and jquery required for the search.
Only channel and name are required.
I've also included template tags for autocomplete_field and
autocompleteselectmultiple_field. autocompleteselectmultiple_field will
require some testing.
Note also that I moved the templates into templates/ajax_select/ so that
they can be referenced in a more django friendly way than being in just
templates.
Original issue reported on code.google.com by alex%[email protected]
on 25 Oct 2009 at 11:38
Attachments:
As it stands, the view which serves up the results is a bit restrictive.
For example, there is no support to add additional arguments besides the
record pk and the formatted object. In my case I wanted to attach a
quantity as well. User's could type in "4x some item". On the way in, the
lookup object works great because I can manipulate the 'q' passed.
A fix would look very similar to format_result in the lookup object, (in
views.py of this project) around:
u"%s|%s|%s" %
(item.pk,lookup_channel.format_item(item),lookup_channel.format_result(item))
A base lookup object could be constructed and subclassed and from it a
format_response method could serve, by default, the above.
Original issue reported on code.google.com by [email protected]
on 23 Oct 2009 at 10:38
The autocomplete formatItem and formatResult are missing the cut:"-"
filter, and thus the autocomplete breaks.
diff --git a/src/ajax_select/templates/autocompleteselect.html
b/src/ajax_select/templates/autocompleteselect.html
index 0aee8f6..d8c6936 100644
--- a/src/ajax_select/templates/autocompleteselect.html
+++ b/src/ajax_select/templates/autocompleteselect.html
@@ -21,8 +21,8 @@ $(function(){
$("#{{html_id}}").after('{% block help %}<p
class="help">{{help_text}}</p>{% endblock %}<input type="hidden"
name="{{name}}" id="{{html_id}}_value" value="{{current_id}}" />');
$("#{{html_id}}").autocomplete('{{lookup_url}}', {
width: 320,
- formatItem: formatItem_{{html_id}},
- formatResult: formatResult_{{html_id}},
+ formatItem: formatItem_{{html_id|cut:"-"}},
+ formatResult: formatResult_{{html_id|cut:"-"}},
dataType: "text"
});
$("#{{html_id}}").result(function(event, data, formatted) {
Original issue reported on code.google.com by [email protected]
on 6 Aug 2009 at 7:18
Add the + (plus sign) in the autocomplete field to support
showRelatedObjectLookupPopup as in
contrib.admin.widgets.ForeignKeyRawIdWidget
Original issue reported on code.google.com by ekagaurangadas
on 25 Nov 2009 at 2:21
When the AutocompleteField* is instantiated, some attributes defined in the
model are lost (e.g. verbose_name, help-text).
This patch set those attributes only if they are defined in the model.
Original issue reported on code.google.com by [email protected]
on 4 May 2010 at 3:33
Attachments:
If you have common global Ajax settings like this in a JavaScript file:
$.ajaxSetup({
type: "POST",
});
What is the expected output? What do you see instead?
An Ajax request returns 200 OK, but doesn't ever return any data. This is a
very silent error.
Please provide any additional information below.
You should either throw an error by not using a default of None in the
ajax_lookup view:
- query = request.GET.get('q', None)
+ query = request.GET['q']
Or do something like this to support POST arguments:
Index: views.py
===================================================================
--- views.py (revision 13)
+++ views.py (working copy)
@@ -6,7 +6,7 @@
def ajax_lookup(request,channel):
""" this view supplies results for both foreign keys and many to many
fields """
- query = request.GET.get('q', None)
+ query = request.GET.get('q', None) if request.method == "GET" else
request.POST.get('q', None)
lookup_channel = get_lookup(channel)
Thanks!
Original issue reported on code.google.com by [email protected]
on 8 Jul 2009 at 8:37
What steps will reproduce the problem?
1. I followed the instructions to install this, except to add the .js (but
this error should not related to this)
2. /admin/my_model/ here everything is fine
3. /admin/my_model/1 => TemplateSyntaxError
What version of the product are you using? On what operating system?
i use the svn revision 27 (the newest)
django 1.1.1
python 2.6.4
Please provide any additional information below.
Environment:
Request Method: GET
Request URL: http://localhost:8000/admin/htags/tag/1/
Django Version: 1.1.1
Python Version: 2.6.4
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.admindocs',
'truemen.slogans',
'truemen.htags',
'truemen.wilson',
'ajax_select']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')
Template error:
In template
/usr/lib/pymodules/python2.6/django/contrib/admin/templates/admin/includes/f
ieldset.html, error at line 12
Caught an exception while rendering: autocompleteselect_tag.html,
autocompleteselect.html
2 : {% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %}
3 : {% if fieldset.description %}<div class="description">{{
fieldset.description|safe }}</div>{% endif %}
4 : {% for line in fieldset %}
5 : <div class="form-row{% if line.errors %} errors{% endif %} {%
for field in line %}{{ field.field.name }} {% endfor %} ">
6 : {{ line.errors }}
7 : {% for field in line %}
8 : <div{% if not line.fields|length_is:"1" %} class="field-box"{%
endif %}>
9 : {% if field.is_checkbox %}
10 : {{ field.field }}{{ field.label_tag }}
11 : {% else %}
12 : {{ field.label_tag }} {{ field.field }}
13 : {% endif %}
14 : {% if field.field.field.help_text %}<p class="help">{{
field.field.field.help_text|safe }}</p>{% endif %}
15 : </div>
16 : {% endfor %}
17 : </div>
18 : {% endfor %}
19 : </fieldset>
20 :
Traceback:
File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in
get_response
92. response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/lib/pymodules/python2.6/django/contrib/admin/options.py" in
wrapper
226. return self.admin_site.admin_view(view)(*args,
**kwargs)
File "/usr/lib/pymodules/python2.6/django/views/decorators/cache.py" in
_wrapped_view_func
44. response = view_func(request, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/django/contrib/admin/sites.py" in inner
186. return view(request, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/django/db/transaction.py" in
_commit_on_success
240. res = func(*args, **kw)
File "/usr/lib/pymodules/python2.6/django/contrib/admin/options.py" in
change_view
873. return self.render_change_form(request, context, change=True,
obj=obj)
File "/usr/lib/pymodules/python2.6/django/contrib/admin/options.py" in
render_change_form
590. ], context, context_instance=context_instance)
File "/usr/lib/pymodules/python2.6/django/shortcuts/__init__.py" in
render_to_response
20. return HttpResponse(loader.render_to_string(*args, **kwargs),
**httpresponse_kwargs)
File "/usr/lib/pymodules/python2.6/django/template/loader.py" in
render_to_string
108. return t.render(context_instance)
File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render
178. return self.nodelist.render(context)
File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render
779. bits.append(self.render_node(node, context))
File "/usr/lib/pymodules/python2.6/django/template/debug.py" in render_node
71. result = node.render(context)
File "/usr/lib/pymodules/python2.6/django/template/loader_tags.py" in render
97. return compiled_parent.render(context)
File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render
178. return self.nodelist.render(context)
File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render
779. bits.append(self.render_node(node, context))
File "/usr/lib/pymodules/python2.6/django/template/debug.py" in render_node
71. result = node.render(context)
File "/usr/lib/pymodules/python2.6/django/template/loader_tags.py" in render
97. return compiled_parent.render(context)
File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render
178. return self.nodelist.render(context)
File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render
779. bits.append(self.render_node(node, context))
File "/usr/lib/pymodules/python2.6/django/template/debug.py" in render_node
71. result = node.render(context)
File "/usr/lib/pymodules/python2.6/django/template/loader_tags.py" in render
24. result = self.nodelist.render(context)
File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render
779. bits.append(self.render_node(node, context))
File "/usr/lib/pymodules/python2.6/django/template/debug.py" in render_node
71. result = node.render(context)
File "/usr/lib/pymodules/python2.6/django/template/defaulttags.py" in render
155. nodelist.append(node.render(context))
File "/usr/lib/pymodules/python2.6/django/template/loader_tags.py" in render
111. return self.template.render(context)
File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render
178. return self.nodelist.render(context)
File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render
779. bits.append(self.render_node(node, context))
File "/usr/lib/pymodules/python2.6/django/template/debug.py" in render_node
71. result = node.render(context)
File "/usr/lib/pymodules/python2.6/django/template/defaulttags.py" in render
155. nodelist.append(node.render(context))
File "/usr/lib/pymodules/python2.6/django/template/defaulttags.py" in render
155. nodelist.append(node.render(context))
File "/usr/lib/pymodules/python2.6/django/template/defaulttags.py" in render
244. return self.nodelist_false.render(context)
File "/usr/lib/pymodules/python2.6/django/template/__init__.py" in render
779. bits.append(self.render_node(node, context))
File "/usr/lib/pymodules/python2.6/django/template/debug.py" in render_node
81. raise wrapped
Exception Type: TemplateSyntaxError at /admin/htags/tag/1/
Exception Value: Caught an exception while rendering:
autocompleteselect_tag.html, autocompleteselect.html
Original issue reported on code.google.com by [email protected]
on 19 Feb 2010 at 7:09
What steps will reproduce the problem?
The Autocomplete Select Multiple field has troubles when
used more than once on the same page. The kill action for
deleting items is being applied over all nodes wrongly.
What is the expected output? What do you see instead?
Adding the kill action only in the right node.
Please provide any additional information below.
Possible Solution:
http://code.transifex.org/index.cgi/mainline/rev/4a28131b97c9
Original issue reported on code.google.com by [email protected]
on 11 Dec 2009 at 12:45
What steps will reproduce the problem?
1. add another object that use ajax-selects
2. In the form, click '+' to add related object (standard admin)
3. Got a 404
What is the expected output? What do you see instead?
I got a 404.
The url is ajax_select/myapp/myobject/add/?_popup=1
instead of :
admin/myapp/myobject/add...
What version of the product are you using? On what operating system?
svn r30 (2010 April 11) on Linux with Django 1.1.1.
Loooking into view.py, I discover that admin path is hardcoded in
/ajax_select. That's why it does not work.
Here's a simple patch that fix this issue by using Django reverse url
resolver. It works for me. Hope that help.
--- views.py (revision 30)
+++ views.py (working copy)
@@ -3,6 +3,7 @@
from django.contrib.admin import site
from django.db import models
from django.http import HttpResponse
+from django.core import urlresolvers
def ajax_lookup(request,channel):
@@ -42,7 +43,7 @@
themodel = models.get_model(app_label, model)
admin = site._registry[themodel]
- admin.admin_site.root_path = "/ajax_select/" # warning: your URL
should be configured here. I should be able to auto-figure this out but
...
+ admin.admin_site.root_path = urlresolvers.reverse("admin:index")
response = admin.add_view(request,request.path)
if request.method == 'POST':
Original issue reported on code.google.com by [email protected]
on 11 Apr 2010 at 2:00
this is only for cases where the foreign key object is of a type that could be
created by a single text
input (eg. can create one with just a title or name)
This would be something that could be defined by the channel object (which
handles the search).
if the user types in text that does not match any search result and does not
select a search result,
then create the (foreign key) object when it saves.
the channel would have to watch that there were no direct and unique matches,
and that the user
didn't simply ignore the search results selection dialog or type quickly enough
that the search
results don't have a chance to run.
Original issue reported on code.google.com by [email protected]
on 21 Jul 2009 at 6:55
What steps will reproduce the problem?
1. python setup.py bdist --format=rpm
What is the expected output? What do you see instead?
error: line 7: Tag takes single token only: Name: Ajax Select
error: query of specfile build/bdist.linux-i686/rpm/SPECS/Ajax Select.spec
failed, can't parse
error: Failed to execute: "rpm -q --qf
'%{name}-%{version}-%{release}.src.rpm
%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm\\n' --specfile
'build/bdist.linux-i686/rpm/SPECS/Ajax Select.spec'"
What version of the product are you using? On what operating system?
r32 on linux, python 2.5.
By changing the space with a dash in product name in setup.py everything
is ok:
5c5
< setup(name='Ajax Select',
---
> setup(name='Ajax-Select',
Original issue reported on code.google.com by [email protected]
on 18 Apr 2010 at 11:26
Hi
I'm using (since today) your app for two projects i work on, and i made
some little improvements to your code :
* use "build_attrs" in all widgets (in the "render" method) to keep all
attributes
* remove class variables (they all are instance variables, defined in
__init__ and not in the class itself)
* pass "extra_attrs" to template for all widgets
* remove "size=40" in template (useless, dev can set size via css)
* some "beautification" in the python code (homogenization)
* in templates, simplification of javascript (two built functions removed
in each)
Other ideas for the future :
- put all js in one js file (it's easy to put out of the script all django
variables, i did it for my projects)
- give a way to specify some parameters (like width or scrollHeight)
without having to redefine a template
- ability to put the template in an app and not at the root of the
project's templates
- and so on... BUT GREAT WORK it's really useful !!!
My patch is joined
Original issue reported on code.google.com by stephane.angel
on 23 Dec 2009 at 1:00
Attachments:
My project (http://code.google.com/p/django-crm/) is in a transitionary
state from MooTools to jQuery.
Hence I have jQuery.noConflict() enabled and '$' is a reference to
MooTools, not jQuery.
Could you please wrap your code like so:
(function($) {
/* some code that uses $ */
})(jQuery);
so that it works if other JavaScript libraries are enabled? This is a
standard way of handling this issue. See:
http://jquery-howto.blogspot.com/2009/07/jquerynoconflict-resolving-conflicts.ht
ml
Original issue reported on code.google.com by team%[email protected]
on 30 Sep 2009 at 6:35
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.