Wiki

Clone wiki

django-jquery-fields / Home

Examples

BootstrapDateTimePicker widget

For more configuration options see

class ProfileForm(models.ModelForm):
    class Meta:
        model = Profile
        exclude = ('user',)
        widgets = {
            'birth_date': BootstrapDateTimePicker(attrs={'readonly': True}, format='%d.%m.%Y', configuration={
                'language': 'ru',
                'format': 'dd.MM.yyyy',
                'weekStart': 1,
                'startView': 'decade',
                'autoclose': True,
                'pickTime': False,
            }),
        }

ModelChoiceTokenInputField field

For more configuration options see

class ProfileForm(models.ModelForm):
    user = ModelChoiceTokenInputField(
        queryset=User.objects.all(), json_source=reverse_lazy('ajax-user-list'), label=u'User',
        required=True, 
        configuration={
            'hintText': 'Start enter username or email',
            'noResultsText': "Nothing's found",
            'searchingText': 'Searching...',
            'theme': 'facebook',
        },
    )

    class Meta:
        model = Profile

Updated