Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-12-15 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+

Comment (by timgraham):

 I doubt it's acceptable to add a contrib app specific option to `migrate`.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.2a470cd21f1cdbb0552d00849004aab8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-12-15 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+

Comment (by amosonn):

 I think that the other side of not removing stale content types for fear
 of data loss is leaving stale `GenericForeignKey`s, which will break when
 accessed (see #25931). Hard to say which is worse.
 I think perhaps adding a switch to migrate is better:
 `--remove_stale_contenttypes` or `--keep_stale_contenttypes`, and if none
 are present then default to current interactive behaviour.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.6e5b779cdf6b58d24c179730019660d0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-12-14 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+
Changes (by timgraham):

 * owner:  timgraham =>
 * status:  assigned => new


Comment:

 I'd welcome someone continuing where I left off here.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.e266f2e81a7caae7a9b4cb80a21a3b8b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-10-02 Thread Django
#24865: Add a feature to programmatically remove stale content types
-+-
 Reporter:  Protosac |Owner:  timgraham
 Type:  New feature  |   Status:  assigned
Component:   |  Version:  master
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:
 Keywords:  stale contenttypes   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * owner:  nobody => timgraham
 * status:  new => assigned


Comment:

 I started working on the management command described in the previous
 comment: [https://github.com/django/django/pull/5382 PR]

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.dee0bb8d0032877aed72de87ad10fec5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-07-23 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+

Comment (by timgraham):

 Markus and I chatted in IRC and came up with the idea of moving stale
 content types deletion out of the `post_migrate` signal
 `update_contenttypes` function and into a separate
 `remove_stale_contenttypes` management command. This would default to
 `interactive=True` but could be called with
 `call_command('remove_stale_contenttypes', interactive=False)` to delete
 without a prompt.

 How does this sound?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.030254b8a309af203ca92e3bf2505b01%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-07-01 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+
Changes (by timgraham):

 * needs_better_patch:  0 => 1


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.3b47e62354b898e0da4245bc2bd5f7f2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-06-30 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by edmorley):

 * cc: emorley@… (added)


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.61fd6d78db399aaad0e7b355d74e52c0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-06-25 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by timgraham):

 * needs_better_patch:  1 => 0
 * stage:  Ready for checkin => Accepted
 * needs_tests:  1 => 0
 * needs_docs:  1 => 0


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.ff3fabbe56f5ec45c02f1d5762415282%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-06-24 Thread Django
#24865: Add a feature to programmatically remove stale content types
-+-
 Reporter:  Protosac |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:   |  Version:  master
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:
 Keywords:  stale contenttypes   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Protosac):

 * stage:  Accepted => Ready for checkin


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.2f7dd1f05eba750fb1f88bf2b3aec50e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-06-24 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  1 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Protosac):

 * cc: Protosac (added)


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.b2b0acb3f0e2ba1b58ba827ea5a7aec9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-06-18 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  1 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+

Comment (by MarkusH):

 Tim, neither patch is guaranteed to work when a user has not applied all
 `contenttypes` migrations, as the model used inside the
 `update_contenttypes` is from the global apps, not from the latest applied
 migration state (see #24100 for that).

 Anyway, I'm ok with making it a public API if we put a `.. warning::` box
 around the docs and state the potential data loss due to cascading.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.6c0eff0d0e8b0c77b6ab4e03851e005d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-06-18 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  1 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+

Comment (by timgraham):

 Markus, can you elaborate on the data loss concerns? I guess it's about
 the possibility of delete cascades which is why interactive prompts were
 originally added in #12339. I don't think there's much value in completing
 this ticket if it isn't a public API. I'd think documentation that
 explains the data-loss considerations would do more to educate users than
 keeping the function private would. If you have another idea on how to
 address the use case in #24820 I'm open to alternatives.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.62777b0371015bffcfb67139d7fca271%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-06-18 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  1 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+
Changes (by MarkusH):

 * needs_better_patch:  0 => 1


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.e89330e79b3a793adaca284f170d28ab%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-06-18 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by MarkusH):

 I think `remove_contenttypes()` should remain private as well. It's way
 too easy to loose data when using that function. I'd put the respective
 documentation for that method into the function's docstring.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.3d0455c18788a0701429916674a93de4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-06-03 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by timgraham):

 Tests would ensure that the `remove_contenttypes()` function performs the
 job it's expected to do (deleting content types for the given `app`).

 For docs, I'd suggest to add a "Utilities" section which documents
 `remove_contenttypes()`. No need to document the `update_contenttypes()`
 method -- that should remain a private function in my opinion.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.ddc2237be69dbaa0a3faea0e9a7e982e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types

2015-06-03 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Protosac):

 Replying to [comment:1 timgraham]:
 > Could you please send a pull request with tests and documentation? You
 may find the [https://docs.djangoproject.com/en/dev/internals/contributing
 /writing-code/submitting-patches/#patch-review-checklist patch review
 checklist] helpful.

 I've looked the specs over and I'm not sure this warrants a test. The
 current Django tests for `update_contenttypes` already test for
 interactive. All this change does is automatically respond to it's prompt
 in the very same way the `test_interactive_true` does.

 
 def test_interactive_true(self):
 """
 interactive mode of update_contenttypes() (the default) should
 delete
 stale contenttypes.
 """
 management.input = lambda x: force_str("yes")
 with captured_stdout() as stdout:
 management.update_contenttypes(self.app_config)
 self.assertIn("Deleting stale content type", stdout.getvalue())
 self.assertEqual(ContentType.objects.count(), self.before_count)
 
 As for documentation I was considering placing it in the contenttypes.txt
 and adding a Management section to describe the `force_remove` argument
 and `remove_contenttypes` method. If that's an inappropriate place, please
 make a recommendation. Thanks again.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.9e3c31a85fbbb6c7ebad54fd76457b16%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24865: Add a feature to programmatically remove stale content types (was: Adding a feature to programmatically remove stale content types)

2015-05-27 Thread Django
#24865: Add a feature to programmatically remove stale content types
--+
 Reporter:  Protosac  |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  contrib.contenttypes  |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  stale contenttypes| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  1
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by timgraham):

 * needs_better_patch:   => 0
 * component:  Uncategorized => contrib.contenttypes
 * needs_tests:   => 1
 * version:  1.7 => master
 * needs_docs:   => 1
 * stage:  Unreviewed => Accepted


Comment:

 Could you please send a pull request with tests and documentation? You may
 find the [https://docs.djangoproject.com/en/dev/internals/contributing
 /writing-code/submitting-patches/#patch-review-checklist patch review
 checklist] helpful.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.3a9fd6fd7963120aaa1b7a20dff0dbd7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.