Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

ManyToManyRel' object has no attribute 'parent_model #57

Open
MUDASSARHASHMI opened this issue Aug 20, 2016 · 1 comment
Open

ManyToManyRel' object has no attribute 'parent_model #57

MUDASSARHASHMI opened this issue Aug 20, 2016 · 1 comment

Comments

@MUDASSARHASHMI
Copy link

MUDASSARHASHMI commented Aug 20, 2016

In utils.py at following line its hard to understand its like "tuple + tuple + list".
fields = Model._meta.fields + Model._meta.many_to_many + Model._meta.get_all_related_objects()
This is caused me error so I converted it to tuple(Model._meta.get_all_related_objects()).
However now I am getting error with following traceback:

File "C:\Users\Mudassar\dressikarepo\lib\site-packages\django\core\handlers\base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\Mudassar\dressikarepo\lib\site-packages\django\contrib\admin\options.py" in wrapper
  616.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "C:\Users\Mudassar\dressikarepo\lib\site-packages\django\utils\decorators.py" in _wrapped_view
  110.                     response = view_func(request, *args, **kwargs)
File "C:\Users\Mudassar\dressikarepo\lib\site-packages\django\views\decorators\cache.py" in _wrapped_view_func
  57.         response = view_func(request, *args, **kwargs)
File "C:\Users\Mudassar\dressikarepo\lib\site-packages\django\contrib\admin\sites.py" in inner
  233.             return view(request, *args, **kwargs)
File "C:\Users\Mudassar\dressikarepo\lib\site-packages\drip\admin.py" in add_view
  83.             request, extra_context=self.build_extra_context(extra_context))
File "C:\Users\Mudassar\dressikarepo\lib\site-packages\drip\admin.py" in build_extra_context
  78.         extra_context['field_data'] = json.dumps(get_simple_fields(User))
File "C:\Users\Mudassar\dressikarepo\lib\site-packages\drip\utils.py" in get_simple_fields
  121.     return [[f[0], f[3].__name__] for f in get_fields(Model, **kwargs)]
File "C:\Users\Mudassar\dressikarepo\lib\site-packages\drip\utils.py" in get_fields
  98.                 RelModel = field.related.parent_model

Exception Type: AttributeError at /admin/drip/drip/add/
Exception Value: 'ManyToManyRel' object has no attribute 'parent_model'

I am using djagno 1.8.5. Please advise.

@agliottone
Copy link

try my version fixed for new django https://github.com/agliottone/django-drip-2/tree/master

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

No branches or pull requests

2 participants