Skip to content
Commits on Mar 18, 2013
  1. @ralphbean
  2. @ralphbean

    0.1.6

    ralphbean committed Mar 18, 2013
  3. @ralphbean

    Merge pull request #6 from RobertSudwarts/develop

    Committer: RobertSudwarts <robertsudwarts@gmail.com>
    ralphbean committed Mar 18, 2013
  4. Committer: RobertSudwarts <robertsudwarts@gmail.com>

    Upgraded select2 plugin files from v2.0 to v3.3.1
    
    	modified:   tw2/jqplugins/select2/static/README.md
    	modified:   tw2/jqplugins/select2/static/select2.png
    	modified:   tw2/jqplugins/select2/widgets.py
    	modified:   tw2/jqplugins/select2/static/select2.js
    	modified:   tw2/jqplugins/select2/static/select2.css
    	modified:   tw2/jqplugins/select2/static/select2.min.js
    	modified:   tw2/jqplugins/select2/samples.py
    	new file:   tw2/jqplugins/select2/static/LICENSE
    	new file:   tw2/jqplugins/select2/static/component.json
    	new file:   tw2/jqplugins/select2/static/select2.jquery.json
    	new file:   tw2/jqplugins/select2/static/select2_locale_es.js
    	new file:   tw2/jqplugins/select2/static/select2_locale_hu.js
    	new file:   tw2/jqplugins/select2/static/select2_locale_it.js
    	new file:   tw2/jqplugins/select2/static/select2x2.png
    	renamed:    tw2/jqplugins/select2/static/spinner.gif -> tw2/jqplugins/select2/static/select2-spinner.gif
    RobertSudwarts committed Mar 18, 2013
Commits on Nov 13, 2012
  1. @ralphbean
  2. @ralphbean

    0.1.5

    ralphbean committed Nov 12, 2012
  3. @ralphbean

    Added an authors file.

    ralphbean committed Nov 12, 2012
  4. @ralphbean

    Added travis config.

    ralphbean committed Nov 10, 2012
Commits on Nov 11, 2012
  1. @may-day

    Select2 has two operation modes:

    1) read data from the options of an existing select element -> select2 must attached to an select element
    2) handle data them internally (set them on initialization or load them through ajax) -> select2 must be attached to an hideen input element
    
    If you want an entry to be selected the format is different for the cases mentioned above:
    1) either a single string if you have a single selection element or a list of strings if you have a multiple selection element
    2) either an object {id:<idvalue>, text:<textvalue>} if you have a single sleection element or a list of such objects if you have a multiple selection element
    
    nb: you can have more props in the object, those mentioned are the minimum for the default renderer
    
    To facilitate these options i added a new parameter `ondemand` which covers the 2nd case mentioned above when it's value is True.
    The default value is False though thus implementing option 1.
    may-day committed Nov 11, 2012
  2. @may-day

    added default parameter for nosetest's cover plugin to cover only thi…

    …s package and generate html output in the `cover` directory
    may-day committed Nov 11, 2012
  3. @may-day
Commits on Nov 9, 2012
  1. @ralphbean
  2. @ralphbean

    0.1.4

    ralphbean committed Nov 9, 2012
  3. @ralphbean

    Added test for #4. Fixes #4.

    ralphbean committed Nov 9, 2012
  4. @ralphbean

    Unicode.. not str, please.

    ralphbean committed Nov 9, 2012
  5. @ralphbean

    Bugfix related to #4.

    ralphbean committed Nov 9, 2012
  6. @ralphbean

    PEP8 Cosmetic

    ralphbean committed Nov 9, 2012
Commits on Aug 27, 2012
  1. @ralphbean
  2. @ralphbean
  3. @bjonnh @ralphbean
  4. @bjonnh @ralphbean

    Bug fix for single DB elements.

    bjonnh committed with ralphbean Jul 1, 2012
Commits on Jun 25, 2012
  1. @ralphbean
  2. @ralphbean
  3. @bjonnh
  4. @bjonnh
  5. @bjonnh
  6. @bjonnh
  7. @bjonnh

    Adding a way to set initial values.

    self.value : sqlalchemy collectionadapter or array of dicts
    self.fields : contains fields of the model to be selected (avoid sending the whole data)
    
    User must be careful to use the right results callback e.g:
    
    class FractionField(Select2AjaxSingleSelectField):
        options = []
        opts = dict(
            multiple=True,
            ajax=dict(
                url="/fetch_fractions",
                dataType="json",
                data=twc.js_callback(
                    """
                    function (term, page) {
                        return {
                            q: term, // search term
                        };
                    }
                    """),
                results=twc.js_callback(
                    """
                    function (data, page) {
                        return {results: data.data};
                    }
                    """),
                ),
            formatSelection=twc.js_callback(
                """
                function (row) {
                    return row.code;
                }
                """),
            formatResult=twc.js_callback(
                """
                function (row) {
                    return row.code;
                }
                """),
       )
    
    where row.code is the data to be displayed to the user.
    bjonnh committed Jun 25, 2012
Commits on Jun 7, 2012
  1. @ralphbean
  2. @ralphbean

    Version bump for fixes.

    ralphbean committed Jun 7, 2012
  3. @ralphbean

    un-wordwrapping.

    ralphbean committed Jun 7, 2012
  4. @ralphbean
  5. @ralphbean
  6. @ralphbean

    Remove dev info in egg data.

    ralphbean committed Jun 7, 2012
  7. @ralphbean
Something went wrong with that request. Please try again.