Giter VIP home page Giter VIP logo

django-ajax-filtered-fields's People

Contributors

frankban avatar

Watchers

 avatar

django-ajax-filtered-fields's Issues

How can ajaxforeignkeyfields be used within inlines?

Apologies, but I'm not clear from the docs on whether/how this can be done... 
It would be very nice to be able to use the foreign key field within inlines 
where a large number of foreignkey objects are available.

Original issue reported on code.google.com by [email protected] on 19 Oct 2010 at 8:50

The temp fix for issue 16 breaks validation

The following line in the clean method of AjaxForeignKeyField had a bug
forms.Field.clean(self, value)

It was commented out as a temp fix but now validation is broken.

I have a model field that has null=false but validation doesn't work so I'm 
getting an exception.

Is there a way to solve both issues?

Thanks


Original issue reported on code.google.com by [email protected] on 30 Jun 2010 at 5:13

Load content on-request to increase performance

In case of lots of objects to select into a filtered field the page loads 
slowly.

Django's native filter_horizontal and filter_vertical widgets have the same 
problem.

The possible solution would be to load not all the data but only the number of 
rows needed to fill the visible part of the widget and to load the rest of data 
when user clicks the search field or tries to scroll the list.

What do you think on it?

I'm using 0.5.

Original issue reported on code.google.com by [email protected] on 12 Nov 2010 at 2:58

How can ajaxforeignkeyfields be used within inlines?

Apologies, but I'm not clear from the docs on whether/how this can be done... 
It would be very nice to be able to use the foreign key field within inlines 
where a large number of foreignkey objects are available.

Original issue reported on code.google.com by [email protected] on 19 Oct 2010 at 8:50

ehancement request : add setup.py

I am working on fairly large cms that is going to be open sourced soon and
I am particularly interested you app. However out installation procedure is
based on pip. So in order to do this we need to have a setup.py to install
the package.

It would be nice if you could add such file. 

Regards,
--yml


Original issue reported on code.google.com by [email protected] on 9 Mar 2009 at 7:28

Django 1.7 incompatibility - solved

Raises error with JSON imports. 

Solution: change in dist packages / views.py:

from django.utils import simplejson

to

import json as simplejson

Original issue reported on code.google.com by [email protected] on 5 Nov 2014 at 2:21

lookups attribute should be able to handle an empty tuple

when using an empty tuple for the lookups attribute with AjaxManyToManyField
there is an error:
File "/home/user/project/ajax_filtered_fields/forms/fields.py", line 53, in
__init__
    lookup_dict = lookups_list[default_index][1]
IndexError: list index out of range

When using a callable to dynamically set lookups it might be set to an
empty tuple if the db is empty:
def get_lookups():
   objs = MyModel.objects.values_list('manufacturer', flat=True).distinct()
   return tuple((c, {'manufacturer': c.replace("'","\\'" )}) for o in objs) 




Original issue reported on code.google.com by [email protected] on 17 Apr 2010 at 10:48

Invalid choice on save.

If you experience this error using the AjaxForeignKeyField (may happen on other 
fields as well...), it is because the field's built in to_python method filters 
on the "default" queryset that is created during __init__ which limits the 
queryset to the first of the lookups.

The fix is pretty simple:

    def to_python(self, value):    
        if value in forms.fields.EMPTY_VALUES:
            return None

        # if there is only one lookup used to limit choices, then a real
        # validation over that limited choices is performed
        lookups_list = utils.getLookups(self.lookups)
        limit_choices_to = {} if len(lookups_list) != 1 else lookups_list[0][1]

        try:
            key = self.to_field_name or 'pk'
            limit_choices_to[key] = value
            value = self.model.objects.get(**limit_choices_to)
        except (ValueError, self.queryset.model.DoesNotExist):
            raise ValidationError(self.error_messages['invalid_choice'])
        return value

Original issue reported on code.google.com by [email protected] on 20 Aug 2011 at 9:40

Autocomplete widget

while reviewing your reusable app I found a similar app done by jezdez.
which is available here :
http://code.google.com/p/django-command-extensions/wiki/AdminExtensions
Here it is another video showing it in action:
http://www.flickr.com/photos/jannis/3246408003/

I like the autocomplete widget a bit better that the by letter approach.
The widget is a bit more compact. However the overall architecture that you
have built seems to be much more flexible and expendable. 

I would be glad to hear from you on this.
Thanks 
--yml

Original issue reported on code.google.com by [email protected] on 10 Mar 2009 at 4:23

Example of use of the AjaxForeignKeyField

What steps will reproduce the problem?
1. I tried use AjaxForeignKeyField for filter select-box of cities by 
select-box of states in a add form of the 'Projects'

models.py

class Project(models.Model):
     city = models.ForeignKey(Cidade, null=True, blank=True)    
     state = models.ForeignKey(Estado, null=True, blank=True)


Follow the code in Project modelForm:

related_objects = AjaxForeignKeyField(City, ('name', {}), default_index=0, 
select_related='states', *args, **kwargs)


What is the expected output? What do you see instead?
I want filter select-box of cities by states. But don´t found examples in 
documentation...

What version of the product are you using? On what operating system?
Django version 1.0.  Windows XP

Please provide any additional information below.



Original issue reported on code.google.com by [email protected] on 14 Apr 2009 at 2:00

can we have a more detailed example of use?

Can you provide some more detailed examples of how to use your plugin? I had a 
go but run into 
lots of errors... then I thought I might not have understood it properly.

In particular, if used with the Admin, how do you integrate it with the usual 
way of doing things. 
E.g.: 
class MyModelAdmin(admin.ModelAdmin):
... etc....


thanks

Original issue reported on code.google.com by michele.pasin on 1 Sep 2009 at 4:35

null beeing trasmitted with Win XP & IE8 8.0.6001.1870260

What steps will reproduce the problem?
1. Use AjaxForeignKeyField
2. Select an entry
3. Press "Save"

What is the expected output? What do you see instead?
The id of the selected entry

What version of the product are you using? On what operating system?
0.5

Please provide any additional information below.
The value "null" will be transmitted if an element is selected and then "Save" 
is beeing pressed. If one selects an entry and clicks outside of the select box 
the correct ID for the entry is beeing submitted.

Original issue reported on code.google.com by [email protected] on 29 Mar 2011 at 7:39

model verbose_name not respected

What steps will reproduce the problem?
1. Set a verbose name on a model field (e.g. many to many field)
2. Add a AjaxManyToManyField on the model
3. Note that verbose_name does not appear in the Admin interface

What is the expected output? What do you see instead?
Expect to see verbose name — see original name

What version of the product are you using? On what operating system?
Django 1.2 on os x 10.6

Happy to send models and admin example if needed.

Original issue reported on code.google.com by [email protected] on 17 Oct 2010 at 8:31

Multiplying selected values if form doesn't cleaned.

What steps will reproduce the problem?

1. Assume that we have such form:
    class TaskForm(forms.ModelForm):
        class Meta:
            model = Task
            fields = ('name', 'date', 'people')
        people = ManyToManyByLetter(Person, field_name='username')

2. Select some values in the people widget. For exmaple we selected one 
value "Person1".
3. Fill date field with the invalid date and submit the form.
4. Certainly we should be redirected to the current page with the error 
"Invalid date".


What is the expected output? What do you see instead?

There should be no any changes in the people widget, but we can see that 
there appeared one more value in selection area which equals to previously 
selected.


What version of the product are you using? On what operating system?

0.4 Linux


Please provide any additional information below.

The problem is in the method 
forms.widgets.FilteredSelectMultiple._getAllChoices()

choices_keys = [i[0] for i in choices]
for i in value:
    if not i in choices_keys: # here you compare unicode object with 
integer

Possible solution: choices_keys = [str(i[0]) for i in choices]

Original issue reported on code.google.com by [email protected] on 6 Jul 2009 at 12:57

Compatibility issues with Python 2.4

Django is compatible with Python 2.3+, but this pluggable expects Python 2.5+

If someone hits this problem too, the attached diff might help (it was done
semi-manually so it may not be in the right format for direct patching,
sorry). It makes the code compatible with Python 2.4, I don't have 2.3
available.

Original issue reported on code.google.com by [email protected] on 9 Nov 2009 at 2:52

Attachments:

Media are not installed

You need to provide a MANIFEST.in which includes the following line

include-recursive media *

otherwise media/ gets not installed.

Cheers,
-- Federico

Original issue reported on code.google.com by federico.maggi on 14 Dec 2009 at 10:22

AjaxForeignKeyField works only for choices on the first index

When I'm trying to save a form in the admin with AjaxForeignKeyField
I can only choose objects from the initial results.
When trying to load others and choose from them I'm getting validation
error that it's not one of the available choices.

I had to comment the first line in the clean method of AjaxForeignKeyField
#forms.Field.clean(self, value)

Not sure if this line is needed or not.

Original issue reported on code.google.com by [email protected] on 24 May 2010 at 12:01

Can these be Daisy Chained together.

For example I would like something like 

    state = ForeignKeyByRelatedField(State, 'country', include_blank=False)

    city = ForeignKeyByRelatedField(City, 'state', include_blank = False)

So I want the states to be filtered first by selecting country, and then
filtering the cities by selection from this filtered group of states.

Original issue reported on code.google.com by [email protected] on 29 Jan 2010 at 5:23

Problem with AjaxManytoMany Field

Hello,

     I have a model 'A' which contains a foreign key to model 'B'. Since the user has to pick options 
from 17000+ records from model 'B'. I chose to use AjaxFiltered-fields. 

The form renders well for a super user. 
(http://img9.imageshack.us/img9/940/picture2jh7.png)

But for a registered user, non super user. It renders as 
(http://img187.imageshack.us/img187/6177/picture3di6.png)

In my settings.py I set    AJAX_FILTERED_FIELDS_AUTH_DECORATOR = None

Can you tell me why the form is not rendering as desired for a registered user?



Original issue reported on code.google.com by [email protected] on 5 Feb 2009 at 12:30

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.