Obviously a difficult question...
On Saturday, 3 October 2015 23:54:24 UTC+1, Dan Tagg wrote:
-- On Saturday, 3 October 2015 23:54:24 UTC+1, Dan Tagg wrote:
Hi,I'm using django 1.8.4.1. I have added a field "deleted" to a couple of models so that when the delete button is pressed, to all intents and purposes the record will have been deleted, although it should still be accessible through the Admin site.2. To make this happen in a way that can't be easily accidentally ignored I have overiden "get_queryset in this mannerclass AnnotationManager(models.Manager): def get_queryset(self):return super(AnnotationManager, self).get_queryset().filter(deleted=False) and then hadobjects = managers.AnnotationManager()in the Model3. I am also using AutoSlugField. To make sure that doesn't give an integrity error I have had to add another manager AllAnnotationManager and get the AutoSlugField to use it by adding the following keyword argumentmanager=managers.AllAnnotationManager() This works fine as far as integrity is concerned4. However, if I run makemigrations, I get the following errorsFile "manage.py", line 10, in <module>execute_from_command_line(sys.argv) File "/Users/dantagg/envs/cr_3.4/lib/python3.4/site-packages/ django/core/management/__init_ _.py", line 338, in execute_from_command_line utility.execute()File "/Users/dantagg/envs/cr_3.4/lib/python3.4/site-packages/ django/core/management/__init_ _.py", line 330, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Users/dantagg/envs/cr_3.4/lib/python3.4/site-packages/ django/core/management/base. py", line 393, in run_from_argv self.execute(*args, **cmd_options)File "/Users/dantagg/envs/cr_3.4/lib/python3.4/site-packages/ django/core/management/base. py", line 444, in execute output = self.handle(*args, **options)File "/Users/dantagg/envs/cr_3.4/lib/python3.4/site-packages/ django/core/management/ commands/makemigrations.py", line 125, in handle migration_name=self.migration_name, File "/Users/dantagg/envs/cr_3.4/lib/python3.4/site-packages/ django/db/migrations/ autodetector.py", line 43, in changes changes = self._detect_changes(convert_apps, graph) File "/Users/dantagg/envs/cr_3.4/lib/python3.4/site-packages/ django/db/migrations/ autodetector.py", line 186, in _detect_changes self.generate_altered_fields()File "/Users/dantagg/envs/cr_3.4/lib/python3.4/site-packages/ django/db/migrations/ autodetector.py", line 849, in generate_altered_fields new_field_dec = self.deep_deconstruct(new_field) File "/Users/dantagg/envs/cr_3.4/lib/python3.4/site-packages/ django/db/migrations/ autodetector.py", line 67, in deep_deconstruct for key, value in kwargs.items()File "/Users/dantagg/envs/cr_3.4/lib/python3.4/site-packages/ django/db/migrations/ autodetector.py", line 67, in <dictcomp> for key, value in kwargs.items()File "/Users/dantagg/envs/cr_3.4/lib/python3.4/site-packages/ django/db/migrations/ autodetector.py", line 61, in deep_deconstruct path, args, kwargs = deconstructedValueError: too many values to unpack (expected 3)The 5 deconstructed values that are causing the problem areFalseconciliation_resources_db.managers.AllAnnotationManager None(){}The object whose deconstruct method is causing the problem is<class 'conciliation_resources_db.
managers. AllAnnotationManager'> Why is the manager's deconstruct method being called and how do I stop it?
Dan
--Wildman and Herring Limited, Registered Office: 52 Great Eastern Street, London, EC2A 3EP, Company no: 05766374
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4073ad60-b5e5-424c-9682-4be7a4c03388%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment