I'm trying to find facet filtering solution for backbone (collection data). I didn't mean searchbox, but something like here http://www.documentcloud.org/public/search/ - project list in left sidebar.
Is there some library for this stuff?
Thanks!
At my company we are developing this, maybe it might interest you:
https://github.com/arillo/Backbone.Facetr
Related
I am using Django to build data models including a model Company. Some of the fields belonging to this model are limited to set choices using the choices='' argument. Some of these fields have a large number of choices, for example a country CharField which lists all countries. Finding the right value among the long list can be tedious so I want to be able to search across the given choice values. This is easy to do for ForeignKey/ManytoMany fields using autocomplete_fields = [] as seen in the attached screenshot (from a different model) but can't seem to find a method for implementing this with a normal CharField with lots of choices. This seems like something that should be built into the Django for the admin panel but I can't find anything within the docs. Please how can I implement a search/filter dropdown for any given (non FK/m2m) fields? Thanks in advance. If there's anymore information I can provide let me know and I will.
country = models.CharField(max_length=128, choices=COUNTRY_CHOICES, null=True)
Model code added. This COUNTRY_CHOICES array is what I would like to be able to select from in a searchable dropdown list.
I am using Django 1.11 and I'm hoping to get some advice on the best way to approach designing a form where one to may documents can be included using the following Model:
class Document(models.Model):
document_id = models.AutoField(primary_key=True)
document_class = models.CharField(null=True,max_length=255)
document_date = models.DateField(null=True)
document = models.FileField(upload_to='documents/')
When the form is displayed in the template, I need the ability to repeat the document_date & document fields based on the user selecting an "add another document" button. The document_class field is not repeated in the form as it is the same for each record of document captured in the model/database.
From what I have been able to gather so far looking into this, using Formset will be the way to achieve this. Before I head down this path can anyone provide advice if this is the best way or if they recommend an alternative? Other considerations appear to be using Model Formset or Inline Formset. Does anyone have any advice if those methods would be more suited? Any guidance on how to approach this will be greatly appreciated!
I am trying to find a smart way to create a multi-level decision tree selector in angularjs. So, basically what I am looking for is:
If I select Maingroup "GroupA" from a dropdown list, than I should only see the properties from subgroup1 related to GroupA. The subgroup1 should be also a dropdownlist. Then, refining the selection by another dropdownlist, should display only the possible selections based on Maingroup+Subgroup1.
Finally, the value should be displayed.
[{"Maingroup":"GroupA","Subgroup1":"subgroupA1","Subgroup2":"subgroupA21","Value":11.34},
{"Maingroup":"GroupA","Subgroup1":"subgroupA1","Subgroup2":"subgroupA22","Value":40.7},
{"Maingroup":"GroupA","Subgroup1":"subgroupA2","Subgroup2":"subgroupA23","Value":58.23},
{"Maingroup":"GroupA","Subgroup1":"subgroupA2","Subgroup2":"subgroupA24","Value":20.64},
{"Maingroup":"GroupA","Subgroup1":"subgroupA2","Subgroup2":"subgroupA25","Value":74.77},
I have put a screenshot and the json file on github.
Thanks, any suggestion is welcome.
Take a look at angular-ui-tree connected trees demo. The structure can be reused to achieve your goals.
I am using the Filter Component from James Fairhurst for my site
http://www.jamesfairhurst.co.uk/posts/view/cakephp_filter_component/
Now I am stuck, trying to filter the Search Results.
I am trying to do something like i.e. Amazon does:
On the left of the results page, there are Filters like "Rating at least 3 Stars" or "Pricerange".
How could I implement this?
Any ideas where I should start?
Thanks in advance!
I read a lot about tagging in CakePHP but I can't find a "clean" way to save a Post and the Tags to this post. I have all which is necessary the Post Table, Model and Controller, the Tag table, Model and Controller and the posts_tags table. I created the HABTM Associations in the Post and the Tag Model.
If I want to save a new post, I want that CakePHP automagically saves the tags associated to that post, but I can't find the right way for that. In most of the tutorials you have to use a "helper" Function (http://www.jamesfairhurst.co.uk/posts/view/full_cakephp_application_part_5 => "_parse_genres") or something like that, but I thought the deal with CakePHP is it, that this is all done by Cake once you set it up right.
So my question, is there a "clean"-Cake-way to do it, or do I have to use a helper function?
I find it very hard to believe that you didn't find a "proper" way to handle HABTM. There are many, many articles about it. I believe that Cake will save your tags if you set your data array properly. A quick search on The Bakery:
http://bakery.cakephp.org/articles/search/3/HABTM
Will reveal enough. My guess is that you're looking for this:
http://bakery.cakephp.org/articles/view/simple-tagging-behavior
(Note that there is a component which does the same thing, but model behaviour is the right way to go)