Re: Proposal: use SQLAlchemy Core for query generation

2012-07-02 Thread Harro
Ehhm, version numbers aren't decimal numers. 2.0 doesn't have to wait for 1.9. Maybe even drop python 2 for django 2.0? Harro On Saturday, 30 June 2012 21:25:07 UTC+2, Jacob Kaplan-Moss wrote: > > Wow. There's really a lot to think about here, and I'm only just > starting. Thanks fo

Re: Adding an option to re-test only failed tests

2009-10-02 Thread Harro
Sounds like a bad plan, what if by fixing the failed test you break another one? On Sep 29, 6:03 pm, Rob Madole wrote: > I've been using nose for our tests, and one of the features that I > really like is the ability to run the tests again but filter only the > ones that

Re: phone2numeric doesn't convert "Q" or "Z"

2010-01-14 Thread Harro
hmm that's indeed weird. The regex excludes those as well specifically. The Q and Z should be added or a comment should be added to the code explaining the reason for leaving them out. On Jan 14, 11:23 am, Gabriel Hurley wrote: > 1. Is there a reason Django's phone2numeric

AnonymousUser has_perm/has_module_perms function check authentication backends

2010-01-14 Thread Harro
I was having a look at the new 1.2 row level permission support that got added and ran into the problem that the AnonymousUser does not call the authentication backend functions. The default backend doesn't need this, but with a custom backend I might want to implement Guest permissions. I think

Re: M2M Column Names Changed in 1.2 - Breaks Backwards Compatibility

2010-01-14 Thread Harro
Hmm where did the foreign key go on the 1.2 example? And I must say that the name for the modelc column is a bit weird. On Jan 14, 8:13 am, simonb wrote: > I think this tickethttp://code.djangoproject.com/ticket/12386 > identifies a change in the m2m code which breaks

Re: AnonymousUser has_perm/has_module_perms function check authentication backends

2010-01-15 Thread Harro
; On Thu, Jan 14, 2010 at 8:13 AM, Harro <hvdkl...@gmail.com> wrote: > > I was having a look at the new 1.2 row level permission support that > > got added and ran into the problem that the AnonymousUser does not > > call the authentication backend functions. > > > T

Re: AnonymousUser has_perm/has_module_perms function check authentication backends

2010-01-17 Thread Harro
Why wouldn't a AnonymousUser have permissions? Imagine a site where can create photo albums. User A creates two photo albums, one to share with a specific set of users and one that's public. So Album A has no guest permissions, Album B has viewing permissions. Now let's say you can also comment

Re: AnonymousUser has_perm/has_module_perms function check authentication backends

2010-01-18 Thread Harro
request.user.has_perm('permission', obj) And adding my own class won't work because of the same reason. On Jan 17, 9:32 pm, Yuri Baburov <burc...@gmail.com> wrote: > Hi Harro, > > Just create a special "AnonymousUser" as User with id=0, and set it up > with backend/mi

Re: AnonymousUser has_perm/has_module_perms function check authentication backends

2010-01-19 Thread Harro
a permissions check? > > ~Noah Silas > > > 2010/1/18 Łukasz Rekucki <lreku...@gmail.com> > > >> 2010/1/18 Alex Gaynor <alex.gay...@gmail.com>: > >> > On Mon, Jan 18, 2010 at 3:55 PM, Jannis Leidel <jan...@leidel.info> > >> >

Re: AnonymousUser has_perm/has_module_perms function check authentication backends

2010-01-19 Thread Harro
@Janis: I see your point,in my proposal the default model authentication backend always returns False for the AnonymousUser. That would indeed mean guest users have no access at all. But I guess you could write a wrapper that used a function specified in the settings (with a default pointing to a

Re: AnonymousUser has_perm/has_module_perms function check authentication backends

2010-01-19 Thread Harro
oh also: It's kinda like the messages framework rewrite now supporting messages for anonymous users. And I guess making it truely awesome would require permissions for anonymoususers in the default backend too. :( If I have timeI'll see what I can come up with. On Jan 19, 4:34 pm, Jannis Leidel

Re: AnonymousUser has_perm/has_module_perms function check authentication backends

2010-01-23 Thread Harro
behaviour. On Jan 20, 8:49 am, Harro <hvdkl...@gmail.com> wrote: > class User(models.Model): >     permissions = models.ManyToMany('Permission', > through='UserPermission') > > class UserPermission(models.Model): >      user = models.ForeignKey('User', blank=True, null

Re: AnonymousUser has_perm/has_module_perms function check authentication backends

2010-01-26 Thread Harro
I think so far we agree that we need to add something for anonymous users, because the added enhancement currently doesn't add enough to integrate row level permissions as they should be. The problems are: - Anonymous users should check the authentication backend for permissions, so it is

Re: AnonymousUser has_perm/has_module_perms function check authentication backends

2010-01-27 Thread Harro
a login_required or has_perm check. Because a real pluggable app would want to support both :) On Jan 26, 4:01 pm, Florian Apolloner <f.apollo...@gmail.com> wrote: > On Jan 26, 3:19 pm, Harro <hvdkl...@gmail.com> wrote:> - If the default > backend always returns fals

Re: AnonymousUser has_perm/has_module_perms function check authentication backends

2010-01-27 Thread Harro
Added a patch to the ticket. some documentation should also be added. [1] http://code.djangoproject.com/attachment/ticket/12557/supports_anonymous_users.diff [2] http://code.djangoproject.com/attachment/ticket/12557 -- You received this message because you are subscribed to the Google Groups

Re: Any change this could make it in for 1.2?

2010-01-27 Thread Harro
+1 Sick of explaining to dutch customers that I can't translate those texts in the admin. It's a simple patch which doesn't break backwards compatibility at all. On Jan 27, 3:54 pm, Alex Robbins wrote: > This ticket adds label and verbose_name to apps. I know

Re: 1.2 beta?

2010-01-28 Thread Harro
I would also like to point out: http://code.djangoproject.com/ticket/12600 It does break existing code however, because it will look for the preview template somewhere else. On Jan 28, 2:25 am, Ben Firshman wrote: > On 27 Jan 2010, at 22:50, Ben Firshman wrote: > > > > > On

Re: 1.2 Beta tomorrow (Friday)

2010-02-05 Thread Harro
Hope you feel better today :) On Feb 5, 3:35 am, James Bennett wrote: > Due to a combination of exhaustion and illness on the part of the > release manager (me), I'm going to slide the 1.2 beta release one day; > that means beta tomorrow (Friday, February 5, probably

Re: contrib.Auth

2010-02-09 Thread Harro
- Make email unique and username non-required on the model. That would make implementing something that authenticated by email a lot easier :) On Feb 9, 1:34 am, Russell Keith-Magee wrote: > On Tue, Feb 9, 2010 at 8:15 AM, Justin Lilly wrote: > >

Re: contrib.Auth

2010-02-10 Thread Harro
that does this. On Feb 9, 5:54 pm, Vitaly Babiy <vbabi...@gmail.com> wrote: > Vitaly Babiy > > On Tue, Feb 9, 2010 at 3:16 AM, James Bennett <ubernost...@gmail.com> wrote: > > On Tue, Feb 9, 2010 at 2:09 AM, Harro <hvdkl...@gmail.com> wrote: > > > - M

Re: proposal: ask a queryset to not raise exceptions

2010-03-08 Thread Harro
I think it's a good idea, but the implementation needs some work. As a default it should keep working as it does now, to keep backwards compatibility. So I think David's idea is a good one, but I think the method name should be more descriptive, like get_or_none and latest_or_none On Mar 8,

Small "bug" in inline_formsetfactory

2010-03-12 Thread Harro
See ticket: http://code.djangoproject.com/ticket/13095 Just posting the used code here: # models.py class Choice(models.Model): """ A choice in a poll """ poll = models.ForeignKey(Poll, related_name='choices', verbose_name=_('Poll')) choice =

Re: Model validation outside of ModelForms.

2010-03-16 Thread Harro
Just my brainfart when looking at this: Can't you simply add a pre save signal to call the full clean method? Dunno if that will work or not, just the first thing I would try. On Mar 16, 5:12 pm, James Bennett wrote: > On Tue, Mar 16, 2010 at 10:36 AM, orokusaki

Re: logialogin_required does not check User.is_active

2010-04-15 Thread Harro
I think the problem isn't the login_required, but it simply does what it says it does: Check if the user is logged in. For me a user with is_active set to false shouldn't be allowed to login, they either just created an account and still need to verify it or they indicated that they wanted their

Re: Advice on #13260 - '%' in args to urlresolvers.reverse()

2010-04-23 Thread Harro
The thing is, quoted get variables will get unquoted, quoted url parameters won't be unquoted automatically. That's up to the developer to handle. Ran into the same issue today, and for me it made sense to do the quoting before passing it to the reverse function, but for me it was an URL which

Re: djangocon.eu sprints (was Re: Class based generic views in 1.3?)

2010-05-14 Thread Harro
Ah crap.. now you've done it.. now I want to be at the djangocon.eu sprints too.. Why do all the fun things always happen at the same time.. I guess I could stay the thursday. and then go home on friday. Ah well.. I'll have till monday to think about it. On May 14, 4:27 pm, Jeremy Dunck

Re: Proposal: Replace django.contrib.formtools.wizard

2010-05-30 Thread Harro
We had a site where we needed a wizard with the ability to go back and forward and store files. Only allowing files in the last step really isn't an option imho, that just avoiding the problem ;-) What we did was simply store the files in a temporary folder and have a management command to clean

Re: Proposal: Replace django.contrib.formtools.wizard

2010-05-31 Thread Harro
+1 on the storage backend. Can the current filestorage backend be reused for this? On May 31, 10:44 am, Gert Van Gool wrote: > MEDIA_ROOT isn't a good solution. It should use a StorageBackend. > For instance, when you use a load-balancer there is no guarantee that > your

Re: Proposal: Improvements for django.forms

2010-06-03 Thread Harro
I think grouping issues and features requests is always a good thing :) Now about the "Model fields with not-default values". With 1.2 something like that landed to override the widget for fields on ModelForms, but I agree that sometimes you need to change a label or help text for a specific form

Re: Decision required: PostgreSQL minimum versions

2010-06-09 Thread Harro
+1 on option 3. Oldest postgresql we have is 8.2. I pity the fool who didn't upgrade ! On Jun 9, 2:38 pm, Antoni Aloy wrote: > +1 on Drop 7.4 PostgreSQL support. Postgressql 8.x series has lots of > performance and utility features and it would be a pity to remain in >

Re: Beating on an old issue; counter intuitive cascade deletes on foreign keys

2010-06-10 Thread Harro
Also ON DELETE RESTRICT On Jun 10, 8:53 am, Thomas Guettler wrote: > The documentation says django emulates "ON DELETE CASCADE": >    http://docs.djangoproject.com/en/dev/topics/db/queries/#deleting-objects > > But it is missing how to emulate ON DELETE SET NULL. > > In this

Re: Imports in the tutorial

2010-06-10 Thread Harro
I agree, and while we're at it also change the settings.py template to just point to urls instead of project_name.urls On Jun 10, 7:21 pm, Andrew Godwin wrote: > Hi all, > > I noticed today that the tutorial still does imports like "from > mysite.polls.models import Poll",

Re: 'User' object has no attribute 'backend' - issue with using auth.login()

2010-09-25 Thread Harro
Authentication = verification Login = saving the authenticated user so we remember them. Putting login on the user model is a bad idea. That will only make the whole auth app less flexible than it already is. What if I have another model which isn't a user but is able to login. Besides..

Re: Smart extends

2010-10-15 Thread Harro
I wrote an extends tag once that changed the extending template based on a get variable.. The idea was that we could then simply get a part of the website in a lightbox popup without all the "outer content". I removed it afterwards and we did it properly.. it felt dirty. On Oct 15, 3:29 pm, Luke

Re: Ticket #7817: Extending "with" and "include" tags.

2010-10-29 Thread Harro
I would suggest also adding a way to exclude all context except items specified with the with syntax. (nocontext keyword or something like that). Because sometimes I have certainly named items in my context which can also be used in the included template but I don't want there. Sure you can

Re: contrib.staticfiles app concerns

2010-10-29 Thread Harro
I agree, if you want to compress/combine css javascript whatever it's up to the app/tool that does this to fix relative paths and other issues that arrise when compressing/combining files. It has nothing to do with the serving of the files. On Oct 29, 12:04 pm, "burc...@gmail.com"

Re: Call for review and comment: #7539 (ForeignKey on_delete)

2010-11-10 Thread Harro
_/-o_ \o/ On Nov 9, 5:59 pm, Carl Meyer wrote: > This is committed as r14507:http://code.djangoproject.com/changeset/14507 > > Carl -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email

Need some feedback for a fix for #14249

2010-11-23 Thread Harro
I have a patch for #14249 [1], but I ran into a problem with inactive superusers. Right now the active check is done before the superuser check. If we move the inactive check to the authentication backend, the superuser check get's executed before the is_active check, resulting in in_active

Re: RFC: #12815/#12816 -- TemplateResponse and render() shortcut

2010-11-29 Thread Harro
I agree with Jacob on the bake/baked thing.. but maybe it's just CakePHP coming to haunt me :S On Nov 29, 1:09 pm, Ivan Sagalaev wrote: > On 11/29/2010 02:58 PM, Russell Keith-Magee wrote: > > > My counterargument would be this -- if you use TemplateResponse, > >

Re: call_command retval

2010-12-08 Thread Harro
If it does not exist; create a ticket. +1 on both points On Dec 7, 4:13 pm, Marco Paolini wrote: > I think call_command should return something significant > to let the caller know if the command was successful or not. > > Another issue ralated to this is: having an

Re: Need some feedback for a fix for #14249

2010-12-13 Thread Harro
Shameless bump to get some attention for 1.3 :) Would be really nice to have this for 1.3 as it puts us one step closer to making the User model replacable ! I think it might be a good idea to move all the checks to the authentication backend so it works consistently for User.has_perm,

Re: Models.py not loaded at server startup ?????

2010-12-13 Thread Harro
Is this mod_python specific or does it also happen with mod_wsgi or gunicorn? On Dec 13, 3:47 pm, Carl Meyer wrote: > Hi, > > On Dec 12, 4:40 pm, Pakal wrote: > > > Why, then, isn't it specified that all models.py files should be > > loaded by

Re: RFC #12823

2010-12-16 Thread Harro
Made some comments about the bug and the patch. The patch gives the right result, but the JOIN there is a bit weird. On Dec 15, 7:54 pm, Philippe Raoult wrote: > I have produced a patch for this [1] long-standing SQL bug. > > The SQL produced with the patch is

Re: Form Rendering API Proposal

2011-06-23 Thread Harro
Two things: - Will the as_* methods on forms be deprecated? They seem to be a nice shorter version then the new way to do it. - I assume the formconfig calls are for the current context, but can I set them in the base.html and then automatically have them used in all templates extending the

Re: Form Rendering API Proposal

2011-06-24 Thread Harro
1.Disk hits can be avoided using the django.template.loaders.cached.Loader. We have a form rendering system that uses a lot of templates and it's being used in some pretty big websites, so far I haven't notices performance issues because of form rendering and we haven't use the cached loader as

Re: [Looking for feedback] Make Admin raw_id_fields the default choice for FKs, or project-wide configurable

2019-01-16 Thread Harro
How would the raw_id_fields then work? Would that then turn them into selects again or would that be another setting? If you want it in your whole project you could just extend the ModelAdmin and make the raw_id_fields a property that returns all the fields then use that as a base class for

Re: [Looking for feedback] Make Admin raw_id_fields the default choice for FKs, or project-wide configurable

2019-01-18 Thread Harro
The problem is that you can't just use it everywhere, like mentioned earlier it only works if the other side of the relation is also available in the admin (which might not be the case, or only for some of the fields.) I would say add it to the good old djangosnippets

Re: Force "required" fields to be included in a ModelForm

2019-04-17 Thread Harro
I'm against, there are lots of cases where a modelform is used to edit an exitsting object and thus the required fields are already set and you don't want them to be editable. If it's a trivial patch then you should think about extending modelform in your own project enforce it there and then