[Django] #27588: Avoid affixing colon to generated migration name

11 views
Skip to first unread message

Django

unread,
Dec 10, 2016, 1:10:41 PM12/10/16
to django-...@googlegroups.com
#27588: Avoid affixing colon to generated migration name
-------------------------------------+-------------------------------------
Reporter: Charlie | Owner: nobody
DeTar |
Type: | Status: new
Uncategorized |
Component: Core | Version: 1.10
(Management commands) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
This ticket concerns a minor annoyance. When generating migrations using
`./manage.py makemigrations --empty`, it is necessary to edit generated
file to create the migration, so users must pay attention to the filename
generated by the management command. `makemigrations` reports the filename
like this:

{{{
Migrations for 'app':
app/migrations/0056_auto_20161210_1755.py:
}}}

In most X11 terminals, double-clicking on the filename will select the
text between spaces and copy it into the mouse paste buffer. However,
since there's a colon affixed to the end of the generated filename, it
gets selected as well, meaning that it's necessary for users to either
edit the pasted contents prior to use, or carefully select all of the
characters except the colon.

May I suggest simply adding a space between the filename and the colon, so
that double-clicking the name won't select the colon. Or alternatively,
eliminating the colon. Allowing the filename to stand free will prevent
the affixed colon from getting in the way.

A one-character patch to add a space:
{{{
--- makemigrations-orig.py 2016-12-10 10:56:18.224099088 -0700
+++ makemigrations.py 2016-12-10 10:50:45.518233440 -0700
@@ -210,7 +210,7 @@
migration_string = os.path.relpath(writer.path)
if migration_string.startswith('..'):
migration_string = writer.path
- self.stdout.write(" %s:\n" %
(self.style.MIGRATE_LABEL(migration_string),))
+ self.stdout.write(" %s :\n" %
(self.style.MIGRATE_LABEL(migration_string),))
for operation in migration.operations:
self.stdout.write(" - %s\n" %
operation.describe())
if not self.dry_run:
}}}

This would eliminate an annoyance for X11 mouse users, and have no
negative impact on users of other systems. Since it's possible that
someone's parsing the output of `makemigrations` and expecting affixed
colons, it could be considered a breaking change.

--
Ticket URL: <https://code.djangoproject.com/ticket/27588>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 12, 2016, 9:37:43 AM12/12/16
to django-...@googlegroups.com
#27588: Avoid affixing colon to migration name in makemigrations output
-------------------------------------+-------------------------------------
Reporter: Charlie DeTar | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Management | Version: 1.10
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Ready for checkin
* type: Uncategorized => Cleanup/optimization


Comment:

I think the colon could be omitted without any harm.

--
Ticket URL: <https://code.djangoproject.com/ticket/27588#comment:1>

Django

unread,
Dec 12, 2016, 9:38:55 AM12/12/16
to django-...@googlegroups.com
#27588: Avoid affixing colon to migration name in makemigrations output
-------------------------------------+-------------------------------------
Reporter: Charlie DeTar | Owner: nobody
Type: | Status: closed

Cleanup/optimization |
Component: Core (Management | Version: 1.10
commands) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"7a4e2fc5a2a6869089a79170e7d2903e1138bb2e" 7a4e2fc]:
{{{
#!CommitTicketReference repository=""
revision="7a4e2fc5a2a6869089a79170e7d2903e1138bb2e"
Fixed #27588 -- Removed unneeded colon in makemigrations output.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27588#comment:2>

Reply all
Reply to author
Forward
0 new messages