Giter VIP home page Giter VIP logo

django-form-utils's Issues

RemovedInDjango110 warning: render() must be called with a dict, not a Context

/home/polesz/Projects/python/demand/venv/local/lib/python2.7/site-packages/form_utils/templatetags/form_utils.py:43: RemovedInDjango110Warning: render() must be called with a dict, not a Context.

This is an easy fix if you drop support for older (ie. unsupported) versions of Django; I made the change locally and it breaks everything up to and including 1.7.

ImageWidget and Amazon S3

So, the two don't play together when you don't use utilize any thumbnail generator.
The reason is that instead of invoking the ImageField's url method, it performs a "manual" join between the project's media folder and the image path - and that simply doesn't work with remote storages such as Amazon's.

I have forked and fixed it for myself, and would like to send a pull request, but I have can't figure out how to run the tests - for some reason they are in the egg, but not in the app itself...

How do I run the tests?

form_util.forms.BetterModelForm and form_util.forms.BetterForm has a mixins

Hi,
Thanks for your great job !

I'm using autocomplete-light extension to django, but base forms provided with autocomplete and from form_utils are not compatibles : both of them inherit from "django.forms.(Model)Form"

I've posted the same issue on autocomplete-light github.

Thanks for your attention !

RemovedInDjango19Warning

Since the release of Django 1.8 I'm getting this error:

... site-packages/form_utils/forms.py:12: RemovedInDjango19Warning: The django.forms.util module has been renamed. Use django.forms.utils instead.
from django.forms.util import flatatt, ErrorDict

[Question] Adding fields dynamically to a fieldset

Hello,

Iโ€™m trying to create a form with dynamically created fields, adding those fields to field sets depending on some conditions. By inspecting the library code I was trying like this:

class BuildCreateForm(BetterForm):
    description = forms.CharField(label = 'Description')

    def __init__(self, *args, **kwargs):
        product = kwargs.pop('product')

        super(BuildCreateForm, self).__init__(*args, **kwargs)

        for field in product.fields.all():
            field_id = 'field_%s' % field.pk
            self.fields[field_id] = forms.CharField(
                label = field.name,
                required = False)
            self.Meta.fieldsets[0][1]['fields'].append(field_id)

    class Meta:
        fieldsets = [('build_fields', {
            'fields': [],
            'legend': 'Fields'})]

which obviously fails, as adding something to Meta multiple times will be reflected in all instances (ie. refreshing my test page will display one more of the dynamic field after each refresh). As Fieldset has no method to add a field, I was wondering if it is actually possible.

Thanks in advance!

Best,
Gergely

Proposal: migrate project to Jazzband

Hi @carljm, I noticed you marked this project as unmaintained. Do you think there is still value in it? I thought we propose to transition it to the Jazzband to collectively maintain it.

I am mostly using the fieldset functionality, which works well for my use case (I pair it with a custom renderer for django-bootstrap3). I don't know whether the rest of the functionality is still relevant.

ImageWidget depends on having image decoder installed.

In the ImageWidget code, there is a line that checks whether value is an image:

if hasattr(value, 'width') and hasattr(value, 'height'):

This works great unless you don't have decoders that PIL needs for a specific file type.

For example:

If you store a JPEG image in your model but have no need to process it (no decoder or django-thumbnail-app is installed) then when that line runs PIL will throw and catch an IO error, causing the line to interpret as False This means it will render only the file upload input and not the image.

I find that to be unexpected behavior if I have no need for image processing.

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.