jrief / django-angular

Let AngularJS play well with Django
http://django-angular.awesto.com/
MIT License
1.23k stars 294 forks source link

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

Open GJoshi909 opened 3 years ago

GJoshi909 commented 3 years ago

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

  1. """
  2. context = super(NgWidgetMixin, self).get_context(name, value, attrs)
  3. if callable(getattr(self._field, 'update_widget_rendering_context', None)):
  4. self._field.update_widget_rendering_context(context)
  5. return context
  6. 151.class NgBoundField(forms.BoundField): …

  7. @property
  8. def errors(self):
  9. """
  10. Returns a TupleErrorList for this field. This overloaded method adds additional error lists
  11. to the errors as detected by the form validator.
  12. """
dselivanovvv commented 3 years ago

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 commented 3 years ago

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

grouser commented 3 years ago

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

jrief commented 3 years ago

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

AgDude commented 2 years ago

@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 commented 2 years ago

@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 commented 2 years ago

@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 commented 2 years ago

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

AgDude commented 2 years ago

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 commented 2 years ago

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.