Re: Flag Field Type Feature Request

2013-11-01 Thread Sergiy Kuzmenko
I often found this handy too. Here's my implementation on bitbucket[1]. There are tests[2] and documentation[3]. It's something I wanted propose to Django core as well but never found time to do so. :) In my implementation I chose to assign numeric values explicitly: SetField(choices=((1,"pizza")

Re: Proposal: Django Admin Site and "pretty" app name

2012-12-07 Thread Sergiy Kuzmenko
As an alternative to creating AppConfig class, what about registering app names, just like we register ModelAdmin instances: admin.site.register_app_label("myapp", _("My awesome web app")) - Sergiy On Thu, Dec 6, 2012 at 11:57 PM, Pedro J. Aramburu wrote: > As I explained on the Django users f

Re: Proposal: Logout user when they change their password.

2012-01-09 Thread Sergiy Kuzmenko
I'm not sure that invalidating session based on last password change is the right thing to do. If the password has been compromised, this effectively enables an active attacker to deny access to the legitimate user. In case of Django admin site this can be quite disruptive as there is no password r

Re: localization in python code (views, models etc)

2011-07-11 Thread Sergiy Kuzmenko
On Mon, Jul 11, 2011 at 7:02 AM, stan wrote: > > > On Jul 11, 11:36 am, Lachlan Musicman wrote: > > On Mon, Jul 11, 2011 at 18:58, stan wrote: > > > Hi, > > > > > Maybe I missed something, but I didn't found any explanation in the > > > doc about how to localize a date or a number in the python

Re: Wrong error message when user having is_staff=False tries to login to admin

2011-03-09 Thread Sergiy Kuzmenko
IMO, obscuring the reason for admin site access denial only confuses the user. If the attacker has user credentials (and knows admin URL!) the big job has already been done and verifying whether that account is admin or not is trivial enough. There is no added security in displaying wrong error mes

Re: Error: cannot import name SpooledTemporaryFile

2011-02-03 Thread Sergiy Kuzmenko
This list is for discussing the development of Django itself. Please post this type of question to django-users. That error is from the application you are trying to run and has nothing to do with Django itself. cheers On Thu, Feb 3, 2011 at 12:35 PM, b...@live.se wrote: > Hi all , I install dio

Re: Discussion about language discovery - ticket 15168

2011-01-31 Thread Sergiy Kuzmenko
What you are proposing is too idiosyncratic to be part of the Django framework. As already suggested by others it should be trivial enough to create your own middleware to address your needs: if language preference not specified explicitly by the user: set it to the language of your choice Put

Re: #15183: wont fix follow up

2011-01-28 Thread Sergiy Kuzmenko
pply query set filters. Does this make sense? On Fri, Jan 28, 2011 at 11:12 AM, Sergiy Kuzmenko wrote: > Thanks for you input Russ. Yes, Count("*") does look cleaner but > (based on a quick glance on the code) may require some serious > rewiring. I'll give some

Re: #15183: wont fix follow up

2011-01-28 Thread Sergiy Kuzmenko
eers Sergiy On Fri, Jan 28, 2011 at 10:36 AM, Russell Keith-Magee wrote: > On Fri, Jan 28, 2011 at 11:05 PM, Sergiy Kuzmenko > wrote: >> A couple of points regarding this: >> http://code.djangoproject.com/ticket/15183#comment:1. >> >> If nulls should not be c

#15183: wont fix follow up

2011-01-28 Thread Sergiy Kuzmenko
A couple of points regarding this: http://code.djangoproject.com/ticket/15183#comment:1. If nulls should not be counted then then they should be excluded from results but they are not. You always get an entry for nulls (if they are present) with zero count which if you need them is a problem and i

Re: annotating fields with null=True

2011-01-27 Thread Sergiy Kuzmenko
27;ll go ahead and will file a bug in track. Cheers On Wed, Jan 26, 2011 at 10:03 AM, Sergiy Kuzmenko wrote: > I want to be able to count how many times each value (including nulls) > is present. I think that exactly what count is for. -:) > > Upon a closer look the problem is not l

Re: annotating fields with null=True

2011-01-26 Thread Sergiy Kuzmenko
ing something, but if you count all the defined > foreign keys AND all the null values, won't you just end up with a > count of the parent model? Or are you saying that you explicitly want > to count how many values are null *instead of* defined? > > On Jan 25, 2:39 pm, Se

annotating fields with null=True

2011-01-25 Thread Sergiy Kuzmenko
Hi there! Annotating a nullable foreign field with Count seems to always return the count of null values as zero (at least in MySQL environment). A quick look into this problem reveals that the corresponding SQL clause is generated as `count()` [1]. This causes to exclude null values from annotati

Re: Feature suggestion: auto translate verbose names

2011-01-14 Thread Sergiy Kuzmenko
It sounds like the concern here are repetitive and untidy lines with lots of "verbose_name" so use of positional arguments may prettify a bit field definitions. It is not obvious from documentation (all fields are listed alphabetically) but for all except relationship fields verbose_name is the fir

ticket #14570 for 1.3?

2010-11-02 Thread Sergiy Kuzmenko
Sorry if I'm being impatient here but I don't want to start raising this question when it's too close to complete feature freeze. Is it possible to include ticket #14570[1] into 1.3 release? It is a rather trivial change which will help generate correct long date display in certain locales. [1] -

Re: Re: humanize.ordinal is very English-specific

2010-03-25 Thread Sergiy Kuzmenko
... just to clarify: > There appears to be some confusion here. The pluralize filter *already > exists*. It has existed since Django was open sourced. if you have > complex pluralization rules to support, it wont work, but in those > cases, you can use {% blocktrans %} in templates, or calls to > u

Re: Re: humanize.ordinal is very English-specific

2010-03-25 Thread Sergiy Kuzmenko
sh or Chinese. On Wed, Mar 24, 2010 at 8:49 PM, Russell Keith-Magee wrote: > On Thu, Mar 25, 2010 at 8:32 AM, Sergiy Kuzmenko wrote: >>> If you have any suggestions for how we could expose ungettext better >>> in templates, I'm all ears. However, given the complexit

Re: Re: humanize.ordinal is very English-specific

2010-03-24 Thread Sergiy Kuzmenko
> If you have any suggestions for how we could expose ungettext better > in templates, I'm all ears. However, given the complexity of > pluralization rules and pluralization usage in the general case, it's > not a simple task. Suggestions welcome. My suggestion is to make pluralization compatible

Re: Call for review: i18n-improvements

2009-12-20 Thread Sergiy Kuzmenko
Few weeks ago I made a proposal for an alternative month representation format as may be required by some locales (most Slavic languages and Greek, maybe others): http://code.djangoproject.com/ticket/12309 This would allow to generate grammatically correct full text date representations such as "J

why last_login in django.contrib.auth.models.User cannot be null?

2009-12-14 Thread Sergiy Kuzmenko
I wonder if there is a particular reason why last_login field of is not defined as "null=True"? It makes sense to me to have it as null which would mean that the user never logged in. Could there be any dependencies relying on this field not being null? Thanks Sergiy -- You received this messag