Git Product home page Git Product logo

crispy-forms-foundation's Introduction

crispy-forms-foundation's People

Contributors

adericbourg avatar adrienbrunet avatar bxm156 avatar carsolcas avatar flesser avatar jrast avatar manuphatak avatar mpasternak avatar nickdjones avatar oubiga avatar philipgarnero avatar sparrowme avatar superman32432432 avatar sveetch avatar xbello avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

crispy-forms-foundation's Issues

Form filefield is a bit ugly

Using Foundation 5, the filefield layout generated is less than ideal.

It would at least be nice to get a little space between the file name and the "clear" checkbox.

invoice-file-field-crispy

Django 1.11 support?

Noticed that this does not support Django 1.11.

Update: I had issues getting the test suite to run locally. Happy to resolve this issue if you have any pointers?

Django 2.0 error

I have encountered this same issue two times in Django 2.0 involving different package, this is the error.

Exception Value: not enough values to unpack (expected 2, got 0)

{% if not field|is_checkbox and not field|is_checkboxselectmultiple %}
  {% crispy_field field %}
{% endif %}

thanks.

TemplateSyntaxError at /login/ crispy tag's template_pack argument should be in ('bootstrap', 'uni_form', 'bootstrap3')

All made by manual but I get this error.
settings.py
INSTALLED_APPS = [
'flat', # django-flat-theme must be BEFORE contrib.admin

# Django apps
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.humanize',
'django.contrib.syndication',
'django.contrib.staticfiles',

# Third party apps
'compressor',
'crispy_forms',
'crispy_forms_foundation',
'django_extensions',
# Local apps
'base',

]

CRISPY_TEMPLATE_PACK = 'foundation-5'

Django 4.0 support

several test fail, for example
003_fields.py::test_fakefield
sequence item 1: expected str instance, BoundField found

Error rendering

Errors should be rendered as in the foundation documentation (using with an error class).

templates / foundation-5 / field.strict.html

Hello !

Now I see list with errors on top the form/
I want see error as

<div class="large-6 columns error">
      <label>Another Error
        <input type="text">
      </label>
      <small class="error">Invalid entry</small>
    </div>

and in field.strict.html I see similar to what I want. How to use it ?

Sorry for dump question.

"required" added for FileFields even when there's already a file

I think the title is fairly self-explanatory - when you have data-abide set the form indiscriminately adds required="" even when the field should not have it, like when a FileField already has a file set (haven't tested it but this may need to be excluded for RadioSelects too, as you do here https://github.com/sveetch/crispy-forms-foundation/blob/master/crispy_forms_foundation/templatetags/crispy_forms_foundation_field.py#L77). I believe this needs to be fixed here https://github.com/sveetch/crispy-forms-foundation/blob/master/crispy_forms_foundation/forms.py#L70 but I can't see how we might access the form data at this point?

Add Python 3 support

We are using your project in our application and we are seriously planning to migrate our basecode to Python 3. Since django-crispy-templates does support Python 3 at the moment, are you :

  • Planning to add a Python 3 support ?
  • Planning to make this project Python 3-only or do you prefer to keep Python 2 support using Six ?

I am planning a patch to Python 3 but let me know if you are interested or not in it since I really don't plan to use Six and to maintain Python 2 support in this patch.

TypeError: 'Pointer' object is not subscriptable with crispy-forms>=2.0

I'm getting this error with

django-crispy-forms = "^2.0"
crispy-forms-foundation = "^0.9.0"

Traceback (most recent call last):
  File "/app/tbxcodingtask/tracker/test/test_torchbox.py", line 16, in test_create_project
    response = client.get(
               ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/test/client.py", line 836, in get
    response = super().get(path, data=data, secure=secure, **extra)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/test/client.py", line 424, in get
    return self.generic(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/test/client.py", line 541, in generic
    return self.request(**r)
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/test/client.py", line 810, in request
    self.check_exception(response)
  File "/usr/local/lib/python3.11/site-packages/django/test/client.py", line 663, in check_exception
    raise exc_value
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 56, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 103, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/views/generic/base.py", line 142, in dispatch
    return handler(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 180, in get
    return super().get(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 144, in get
    return self.render_to_response(self.get_context_data())
                                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 74, in get_context_data
    kwargs["form"] = self.get_form()
                     ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/django/views/generic/edit.py", line 39, in get_form
    return form_class(**self.get_form_kwargs())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/tbxcodingtask/tracker/forms.py", line 14, in __init__
    super(BaseTrackerForm, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/crispy_forms_foundation/forms.py", line 193, in __init__
    self.init_helper()
  File "/usr/local/lib/python3.11/site-packages/crispy_forms_foundation/forms.py", line 112, in init_helper
    if isinstance(self.fields[pointer[1]].widget,

because pointer seems to be an object Pointer(positions=[1], name='title')

yes they introduced here: https://github.com/django-crispy-forms/django-crispy-forms/pull/1293/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed

New layout elements to make real <button> ?

Actually, layout element like Submit or Button are builded as <input> element. In those days where <button> have real meaning and utility (it can have css pseudo elements, opposed to input element), it becomes required.

CSS classes bugs with crispy>=1.5.x

Seems css classes are not correct with crispy 1.5.x, like Submit() that should be "submit button" but appears to be "btn btn-primary".

Some layout element have internal switch to fallback on some default value depending on used template pack.

Why did it work before and why it don't now ? Have to test on demo.

Foundtion 5 alert boxes errors

I'm using foundation 5. When I have non field errors in my forms an alert box appears. But I cannot to close it. I think this can be fixed by adding a "data-alert" attribute to the div with id errorMsg in these files:

crispy-forms-foundation/crispy_forms_foundation/templates/foundation/errors.html
crispy-forms-foundation/crispy_forms_foundation/templates/foundation/errors_formset.html

Foundation 5

Is the current version supporting / works with foundation v5 ?

sequence item 1: expected str instance, BoundField found

forms.py

class NameForm(forms.Form):
    your_name = forms.CharField(label='Your name', max_length=100)

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_action = 'POST'

views.py

'form': forms.NameForm(),

template

{% load crispy_forms_tags %}
{% crispy form %}

I get the error:
sequence item 1: expected str instance, BoundField found

site-packages/crispy_forms_foundation/templates/foundation-6/field.html, error at line 22

Possibility to add "data-" elements into <div>

I wanted to add a closable div to my crispy-form. Think of some html like:

<form>
  <div class="something" id="close_div" data-closable>
    <input type="button" name="close_button" value="Close" data-close>
  </div>
  ...
</form>

I started with with following layout:

self.helper.layout = Layout(
    Div(css_class="something", css_id="close_div", data_closable=""),
    Button(name="close_button", value="Close", data-close=""),
    ...
)

But unfortunately data-closable and data-close are generated together with ="" as code handles them as any other flat_attrs:

<form>
  <div class="something" id="close_div" data-closable="">
    <input type="button" name="close_button" value="Close" data-close="">
  </div>
  ...
</form>

which does not work in foundation!

Suggestion:
Add keyword list_elements (or something more intuitive) for simple list/tuple elements added to div, like:
Div(css_class="something", css_id="close_div", list_elements=["data-close"])

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.