Tokenfield

2. tokenfield

{
    "label": "FOB Data",
    "url_name": "grid_fob",
    "allowed_user_groups": [],
    "allowed_users": [],
    "view": controller_views.GridView,
    "view_params": {
        "title": "FOB",
        "selectpickers_columns": 3,
        "selectpickers": [
            ...
            {
                "name": "spend__gte",
                "label": "Spend MIN",
                "category": "tokenfield",
                "url_name": "tokenfield_spend_min",
                "space_as_delimiter": False,
                "placeholder": "Type and hit enter",
            },
            ...
        ]
},
                        
                        
.....


urlpatterns += [
    get_url(
            url_name="tokenfield_spend_min",
            view=api_views.TokenFieldAPI,
            view_params={
                "model": custom_models.FobSpend,
                "search_field_name": "spend",
                "search_operator": "gte",
            },
        ),
]
  • name: The field name in the model

  • label: The label shown in the selectpickers in automail

  • category: tokenfield category

  • url_name: The unique url name which is required in the url_patterns

  • multiple: Whether multiple choices are allowed in the type box

  • placeholder: Instruction showed in the type box

Last updated