You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Meta profiling a models.Profile is used. Its ManyToManyField named queries is directly assigned a list of SQLQuery objects. This behaviour has been deprecated in Django 1.10 and removed in Django 2.0.
See actual implementation here.
How to reproduce
Set meta profiling ON by putting the following line in settings.py:
SILKY_META = True
Call any function or view with the profiling turned on
Error
You get the following error:
2018-04-02 16:45:05 [3066] [ERROR] [silk.profiling.profiler::__exit__:40] Exception when performing meta profiling, dumping trace below
Traceback (most recent call last):
File "/django/path/virtualenv/lib/python3.6/site-packages/silk/middleware.py", line 122, in _process_response
collector.finalise()
File "/django/path/virtualenv/lib/python3.6/site-packages/silk/collector.py", line 183, in finalise
profile.queries = profile_query_models
File "/django/path/virtualenv/lib/python3.6/site-packages/django/db/models/fields/related_descriptors.py", line 509, in __set__
% self._get_set_deprecation_msg_params(),
TypeError: Direct assignment to the forward side of a many-to-many set is prohibited. Use queries.set() instead.
Proposed solution
Change direct assignment with .set() method. I will open a PR shortly.
Before
silk/collector.py", line 183, in finalise
profile.queries = profile_query_models
After
silk/collector.py", line 183, in finalise
profile.queries.set(profile_query_models)
The text was updated successfully, but these errors were encountered:
Problem
In Meta profiling a
models.Profile
is used. ItsManyToManyField
namedqueries
is directly assigned a list ofSQLQuery
objects. This behaviour has been deprecated in Django 1.10 and removed in Django 2.0.See actual implementation here.
How to reproduce
Set meta profiling ON by putting the following line in
settings.py
:Call any function or view with the profiling turned on
Error
You get the following error:
Proposed solution
Change direct assignment with
.set()
method. I will open a PR shortly.Before
After
The text was updated successfully, but these errors were encountered: