carljm / django-form-utils Goto Github PK
View Code? Open in Web Editor NEW[UNMAINTAINED] Form enhancements for Django (fieldset and row-attrs support, and more)
License: BSD 3-Clause "New" or "Revised" License
[UNMAINTAINED] Form enhancements for Django (fieldset and row-attrs support, and more)
License: BSD 3-Clause "New" or "Revised" License
/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.
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?
Hi,
Dependencies for 1.0 version need to be changed to point to Django 1.5, as it throws error in forms.py.
cannot import name python_2_unicode_compatible
The python_2_unicode_compatible decorator appeared only in Django 1.5
Currently getting errors under Django 1.7rc1. I have't looked into it in great detail but looks like it's been fixed in this fork - https://github.com/ministryofjustice/django-form-utils/commit/d4d9c611567c2f1c1c50bf4659537d3e6a49c41a
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 !
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
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
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.
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.
Is it possible to define nested fieldsets when defining Meta.fieldsets
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.