Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'django.forms.forms' has no attribute 'BoundField' #357

Open
GJoshi909 opened this issue Sep 3, 2020 · 10 comments
Open

module 'django.forms.forms' has no attribute 'BoundField' #357

GJoshi909 opened this issue Sep 3, 2020 · 10 comments

Comments

@GJoshi909
Copy link

Unable to access certain admin sections with bound forms. Below error shows up when access User page from Django admin.

Request Method: GET
http://10.10.134.239:9005/admin/auth/user/
3.1
AttributeError
module 'django.forms.forms' has no attribute 'BoundField'
/usr/local/lib/python3.6/site-packages/djng/forms/angular_base.py, line 151, in
/usr/bin/python3
3.6.8

/usr/local/lib/python3.6/site-packages/djng/forms/angular_base.py, line 151, in
144. """
145. context = super(NgWidgetMixin, self).get_context(name, value, attrs)
146. if callable(getattr(self._field, 'update_widget_rendering_context', None)):
147. self._field.update_widget_rendering_context(context)
148. return context
149.
150.
151.class NgBoundField(forms.BoundField): …
152. @Property
153. def errors(self):
154. """
155. Returns a TupleErrorList for this field. This overloaded method adds additional error lists
156. to the errors as detected by the form validator.
157. """

@dselivanovvv
Copy link

dselivanovvv commented Dec 10, 2020

Dont know why, but class "BoundField" is in djano/forms/boundfield.py, but not in django/forms/form.py...
so, i changed imports and it works for me...

@jrief
Copy link
Owner

jrief commented Dec 10, 2020

They moved it in Django-3.1.
Patch is currently prepared.

@grouser
Copy link

grouser commented Jan 8, 2021

Yes, I have the same issue. Let us know once the patch is available, thanks.

@jrief
Copy link
Owner

jrief commented Jan 8, 2021

Sorry, please retest with the latest version from GitHub.
I'm currently preparing a new version for it

@AgDude
Copy link
Contributor

AgDude commented Jan 20, 2022

@jrief Any update on a release to include this move? It looks like you handled django 3.1 compatibility a year ago, but there isn't a release for it.

@jrief
Copy link
Owner

jrief commented Jan 20, 2022

@AgDude Please have a look at my follow up project https://github.com/jrief/django-formset

It will replace django-angular, since AngularJS is not maintained anymore. In django-formset I reimplemented the complete form validation in pure TypeScript – no external dependencies (except dev tools of course).

Since you are a long time user of django-angular, we can meet for an online session, so that we can talk about the current migration possibilities.

@AgDude
Copy link
Contributor

AgDude commented Jan 20, 2022

@jrief Thanks for the response. Your new project looks like a really nice approach! I completely agree it is long past time to move away from angular.js. I have mostly moved away from using django forms in my newer applications and use django to build an api. Right now I am looking for the least-resistance means to get a large legacy application onto Django 3.2 LTS. I haven't been through all of the verification yet, I have our unit tests passing using an install of django-angular from git, but I would prefer to get it from pypi.

@jrief
Copy link
Owner

jrief commented Jan 21, 2022

If you want to take over that project, you're welcomed. I don't want to spend more time riding a dead horse.

@AgDude
Copy link
Contributor

AgDude commented Jan 21, 2022

Thanks but no thanks. I suggest you archive the github repo that that the few of us still using it know there won't be any more releases. You are completely justified in not putting more time into this project. I appreciate the time you did put into it. It worked really nicely for some projects of mine when angular.js was at its peak.

@jrief
Copy link
Owner

jrief commented Jan 21, 2022

Anyway, using this library in many of my projects, really helped me to understand how to handle form validation in a DRY manner. In django-formset I reused many of those ideas, so users of django-angular will have a similar user experience.

But this time I did not want to rely on any JS-framework. Although I believe, that django-formset can run with most of the modern ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants