Add an --unapplied option for showmigrations

2019-11-29 Thread Sky Christensen

I'd like to be able to easily see a list of only unapplied migrations.

I often find myself switching to a new branch and wanting to quickly 
find out whether it contains any migrations that are yet to be applied 
to my development database, and what they are.


At the moment I use a plain `./manage.py showmigrations`, but when there 
are lots of migrations, scanning the resulting list to find out which -- 
if any -- migrations are not yet applied is tedious and error-prone.


I'd really like to be able to do something like `./manage.py 
showmigrations --unapplied` or `./manage.py showmigrations -u`, and have 
that produce a list of only the unapplied migrations.


I'll be happy to open a ticket and submit a patch to do this if others 
think the idea has merit.


--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/8ebd8bdddf81b8fe8fe83f8ee2c8faa2%40skychristensen.com.


Re: Add an --unapplied option for showmigrations

2019-12-14 Thread Sky Christensen

Thanks Adam - I hadn't come across that, and think it's what I'm after.

Would it be worth adding a note about this to the "showmigrations" 
section of the docs? It strikes me that that's the place people would 
look for an answer to the question "How can I see a list of just the 
unapplied migrations?".


It could be quite a short note. Something like "To show only the 
unapplied migrations, use `django-admin migrate --plan`."



On 2019-11-29 04:31, Adam Johnson wrote:

I think you want "manage.py migrate --plan" - new in Django 2.2
https://docs.djangoproject.com/en/2.2/ref/django-admin/#cmdoption-migrate-plan

On Fri, 29 Nov 2019 at 10:59, Sky Christensen 
wrote:


I'd like to be able to easily see a list of only unapplied
migrations.

I often find myself switching to a new branch and wanting to quickly

find out whether it contains any migrations that are yet to be
applied
to my development database, and what they are.

At the moment I use a plain `./manage.py showmigrations`, but when
there
are lots of migrations, scanning the resulting list to find out
which --
if any -- migrations are not yet applied is tedious and error-prone.

I'd really like to be able to do something like `./manage.py
showmigrations --unapplied` or `./manage.py showmigrations -u`, and
have
that produce a list of only the unapplied migrations.

I'll be happy to open a ticket and submit a patch to do this if
others
think the idea has merit.

--
You received this message because you are subscribed to the Google
Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit


https://groups.google.com/d/msgid/django-developers/8ebd8bdddf81b8fe8fe83f8ee2c8faa2%40skychristensen.com.

--
Adam

 --
You received this message because you are subscribed to the Google
Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/CAMyDDM2Nb_AWfsx05EVydo4PV20iWbcA4GBbZCT_Rn%3De%3D%3DMFXA%40mail.gmail.com
[1].


Links:
--
[1] 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2Nb_AWfsx05EVydo4PV20iWbcA4GBbZCT_Rn%3De%3D%3DMFXA%40mail.gmail.com?utm_medium=email&utm_source=footer


--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/43b482b485ed96dd4f09ecb655d812f2%40skychristensen.com.


The floatformat filter sometimes returns "-0" rather than "0"

2019-09-12 Thread Sky Christensen

Hi,

I'd like to discuss reopening this wontfix'ed ticket: 
https://code.djangoproject.com/ticket/30761


The issue is that for values between 0 and -0.5, the floatformat filter 
returns "-0", whereas I think that most people would expect it to return 
"0".


The ticket was wontfix'ed because "this behavior is consistent with 
builtin round() and -0 exists in floating-point arithmetic".


Can I propose that in this case the better way to decide the result that 
it should produce is to ask what an ordinary person would expect to see, 
rather than what's consistent with a particular Python function?


When humans round -0.3 to the nearest whole number, we express the 
result as 0, not -0. Given that the point of template tags and filters 
is to make data more human-readable, I think returning "0" is preferable 
in this case than returning "-0".


If this ticket is reopened, I'll be happy to submit a patch for it.

Cheers,

Sky

--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/aec9450abcb511a0bb4a020c770a0483%40skychristensen.com.


Re: The floatformat filter sometimes returns "-0" rather than "0"

2019-09-25 Thread Sky Christensen
It seems that so far two people have replied in favour of re-opening 
this ticket (or maybe make that three people if you count me), and none 
have replied against re-opening it.


It's been two weeks since the last reply.

What's the next step now?


On 2019-09-12 21:52, Adam Johnson wrote:

+1 to swapping -0 for 0

On Thu, 12 Sep 2019 at 12:44, Kye Russell  wrote:


Sounds reasonable. As you said, the template tags (well, this one)
seem to be to prepare things for human consumption, not to expose
computer science intricacies.

If I saw this presented on a website, as a ‘developer-user’,
I’d probably consider it a bug. I’m unsure of other uses of this
filter though.

Kye Russell
Sent from my iPhone


On 12 Sep 2019, at 12:54 pm, Sky Christensen

 wrote:


Hi,

I'd like to discuss reopening this wontfix'ed ticket:

https://code.djangoproject.com/ticket/30761


The issue is that for values between 0 and -0.5, the floatformat

filter returns "-0", whereas I think that most people would expect
it to return "0".


The ticket was wontfix'ed because "this behavior is consistent

with builtin round() and -0 exists in floating-point arithmetic".


Can I propose that in this case the better way to decide the

result that it should produce is to ask what an ordinary person
would expect to see, rather than what's consistent with a particular
Python function?


When humans round -0.3 to the nearest whole number, we express the

result as 0, not -0. Given that the point of template tags and
filters is to make data more human-readable, I think returning "0"
is preferable in this case than returning "-0".


If this ticket is reopened, I'll be happy to submit a patch for

it.


Cheers,

Sky

--
You received this message because you are subscribed to the Google

Groups "Django developers  (Contributions to Django itself)" group.

To unsubscribe from this group and stop receiving emails from it,

send an email to django-developers+unsubscr...@googlegroups.com.

To view this discussion on the web visit



https://groups.google.com/d/msgid/django-developers/aec9450abcb511a0bb4a020c770a0483%40skychristensen.com.


--
You received this message because you are subscribed to the Google
Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit


https://groups.google.com/d/msgid/django-developers/1F8DEBF9-FBEB-4A1C-BE3B-CA9D4507E702%40kye.id.au.

--
Adam

 --
You received this message because you are subscribed to the Google
Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/CAMyDDM3FhTEUmWmpHaAqHuRxCbqHJcH6riS9vQ%2BNjhx3LcGhPA%40mail.gmail.com
[1].


Links:
--
[1]
https://groups.google.com/d/msgid/django-developers/CAMyDDM3FhTEUmWmpHaAqHuRxCbqHJcH6riS9vQ%2BNjhx3LcGhPA%40mail.gmail.com?utm_medium=email&utm_source=footer


--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/f11994750333b35688ad5f8053e1f13f%40skychristensen.com.


Re: The floatformat filter sometimes returns "-0" rather than "0"

2019-09-26 Thread Sky Christensen
Thanks Adam. I wasn't sure if I needed to wait for a core developer to 
re-open the ticket.


I just re-opened it then and I'll get onto writing a patch soon.


On 2019-09-26 20:58, Adam Johnson wrote:

I think you can reopen the ticket and make a pull request!

On Thu, 26 Sep 2019 at 00:55, Sky Christensen 
wrote:


It seems that so far two people have replied in favour of re-opening

this ticket (or maybe make that three people if you count me), and
none
have replied against re-opening it.

It's been two weeks since the last reply.

What's the next step now?

On 2019-09-12 21:52, Adam Johnson wrote:

+1 to swapping -0 for 0

On Thu, 12 Sep 2019 at 12:44, Kye Russell  wrote:


Sounds reasonable. As you said, the template tags (well, this

one)

seem to be to prepare things for human consumption, not to expose
computer science intricacies.

If I saw this presented on a website, as a ‘developer-user’,
I’d probably consider it a bug. I’m unsure of other uses of

this

filter though.

Kye Russell
Sent from my iPhone


On 12 Sep 2019, at 12:54 pm, Sky Christensen

 wrote:


Hi,

I'd like to discuss reopening this wontfix'ed ticket:

https://code.djangoproject.com/ticket/30761


The issue is that for values between 0 and -0.5, the floatformat

filter returns "-0", whereas I think that most people would

expect

it to return "0".


The ticket was wontfix'ed because "this behavior is consistent

with builtin round() and -0 exists in floating-point arithmetic".


Can I propose that in this case the better way to decide the

result that it should produce is to ask what an ordinary person
would expect to see, rather than what's consistent with a

particular

Python function?


When humans round -0.3 to the nearest whole number, we express

the

result as 0, not -0. Given that the point of template tags and
filters is to make data more human-readable, I think returning

"0"

is preferable in this case than returning "-0".


If this ticket is reopened, I'll be happy to submit a patch for

it.


Cheers,

Sky

--
You received this message because you are subscribed to the

Google

Groups "Django developers  (Contributions to Django itself)"

group.

To unsubscribe from this group and stop receiving emails from

it,

send an email to django-developers+unsubscr...@googlegroups.com.

To view this discussion on the web visit







https://groups.google.com/d/msgid/django-developers/aec9450abcb511a0bb4a020c770a0483%40skychristensen.com.


--
You received this message because you are subscribed to the

Google

Groups "Django developers  (Contributions to Django itself)"

group.

To unsubscribe from this group and stop receiving emails from it,
send an email to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit






https://groups.google.com/d/msgid/django-developers/1F8DEBF9-FBEB-4A1C-BE3B-CA9D4507E702%40kye.id.au.


--
Adam

--
You received this message because you are subscribed to the Google
Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it,

send

an email to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit




https://groups.google.com/d/msgid/django-developers/CAMyDDM3FhTEUmWmpHaAqHuRxCbqHJcH6riS9vQ%2BNjhx3LcGhPA%40mail.gmail.com

[1].


Links:
--
[1]




https://groups.google.com/d/msgid/django-developers/CAMyDDM3FhTEUmWmpHaAqHuRxCbqHJcH6riS9vQ%2BNjhx3LcGhPA%40mail.gmail.com?utm_medium=email&utm_source=footer


--
You received this message because you are subscribed to the Google
Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit


https://groups.google.com/d/msgid/django-developers/f11994750333b35688ad5f8053e1f13f%40skychristensen.com.

--
Adam

 --
You received this message because you are subscribed to the Google
Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/CAMyDDM2jQXp3FDjmiHzYoxWM069%3D6royttHd6Av8a4GUT%3DpYmA%40mail.gmail.com
[1].


Links:
--
[1]
https://groups.google.com/d/msgid/django-developers/CAMyDDM2jQXp3FDjmiHzYoxWM069%3D6royttHd6Av8a4GUT%3DpYmA%40mail.gmail.com?utm_medium=email&utm_source=footer


--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/53382700596b014f65d61f94a9d8d872%40skychristensen.com.