Re: Implementation of Object Permissions

2012-04-13 Thread Mike Axiak
How does it compare to the solutions that already exist listed here? http://djangopackages.com/grids/g/perms/ -Mike On Fri, Apr 13, 2012 at 7:56 PM, Moritz S. wrote: > Hi all, > > I have been using django for a while and became happy by the time I > discovered

Re: Django should not use `force_unicode(..., errors='replace')` when parsing POST data.

2012-03-29 Thread Mike Axiak
It should also be noted that it is a terrible user experience to raise an exception in the middle of parsing the multipart parser---a socket error with no error message. Not to say that you can't slurp in the data and raise the exception afterwards, but care has to be given if that strategy is

Re: incorrect check email with 'email_re' in 'django.core.validators'

2011-12-19 Thread Mike Axiak
On Mon, Dec 19, 2011 at 12:51 PM, Ian Kelly wrote: > On Mon, Dec 19, 2011 at 9:36 AM, Maxim Badika wrote: >> Hello all! >> >> i found that >> >> email_re.search(u'my...@mydomain.com.') # with dot at the end of >> address >> >> returns true. I think that

Re: Composite primary keys

2011-03-17 Thread Mike Axiak
Just to be clear, for this to be valid syntax doesn't this idea have to be written as:: class Foo(Model): x = models.FloatField() y = models.FloatField() coords = models.CompositeField(('x', 'y'), db_index=True) a = models.ForeignKey(A) b = models.ForeignKey(B)

Re: Feature request - set variables in template

2010-08-26 Thread Mike Axiak
Perhaps you should ask django-users (or the IRC channel, #django, or stackoverflow, ...), how they would approach solving your particular problem. I know that for me it took a few months before I realized how perfect writing custom template tags (or template inclusion tags) are for many blocks of

Re: django template revision (for 1.4?)

2010-05-26 Thread Mike Axiak
Hello, Also keep in mind that the triple brackets introduce their own set of issues. For example, in LaTeX templates I've seen:: \title{{{ publication.title }}} Which works perfectly fine right now. Would this work under your proposal? Cheers, Mike On Wed, May 26, 2010 at 6:28 PM, Daniel

Re: logging?

2010-05-05 Thread Mike Axiak
Why does this facility need to exist within Django? At least one person [1] has written a middleware to do what you're saying. If it's that important, people will start to use that app. There are certainly many potential features people want out of logging, so it'd definitely be better suited for

Re: Upgrading Trac

2010-04-30 Thread Mike Axiak
On Fri, Apr 30, 2010 at 11:56 AM, Russell Keith-Magee wrote: > So, if we were to integrate a code review tool, it would only be to > support case 3. I don't have any concrete numbers to back me up, but > my gut feeling is that case 3 isn't a time sink for me. There is an

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

2010-01-15 Thread Mike Axiak
not sure phone2numeric is that often called in applications. (As opposed to database/template operations.) I'll leave you with a great comment on python optimization [1]. Cheers, Mike 1: http://www.codeirony.com/?p=9 On Fri, Jan 15, 2010 at 9:15 AM, Mike Axiak <m...@axiak.net> wrote: > If y

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

2010-01-15 Thread Mike Axiak
If you really want to be fast, you can do the following, a la urllib.quote:: _phone_chars = {'a': '2', 'b': '2', 'c': '2', 'd': '3', 'e': '3', 'f': '3', 'g': '4', 'h': '4', 'i': '4', 'j': '5', 'k': '5', 'l': '5', 'm': '6', 'n': '6', 'o': '6', 'p': '7', 'q': '7', 'r':

Re: preventing brute forcing passwords

2009-12-17 Thread Mike Axiak
Hey guys, How slow can brute force attacks be? That is, why not just let the web server/load balancer/network stack rate limit client connections to prevent DoS, and effectively thwart brute force attacks? (I have no idea how good password guessing has been these days, so this isn't the most

Re: Perl port of the django template system.

2008-12-16 Thread Mike Axiak
Hi, > Changing the namespace is not that easy, sadly. But I can make a > statement that this has nothing to do with the Djangoproject into the > namespace description. That one can be seen everywhere the name is > displayed. Um... I know you registered your namespace with CPAN, but as far as I

Re: Additional Fields in Core

2008-12-15 Thread Mike Axiak
I'd much rather see a contrib app for these. E.g.:: from django.contrib.datafields import fields as datafields class MyModel(models.Model): my_yaml = datafields.YAMLField() ... and any refactoring that's necessary to facilitate this cleaning should be dealt with. (And I

Re: BitmaskField

2008-12-05 Thread Mike Axiak
I seem to be missing something. Why is it that you cannot just write a BitMaskField yourself outside of Django? I thought that it might have been that we don't have __any and __all lookup types, but it seems you can override get_db_prep_lookup in a field, so that's not an issue. And if there do

Re: API question for model saving

2008-04-28 Thread Mike Axiak
On Apr 28, 3:06 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > thought the behavior of this option was clear from Malcolm's initial > description.  It does support the 1,2,3 you specify.  Which alternative > would you prefer? Maybe it's just me, but I just don't like a parameter that seems

Re: API question for model saving

2008-04-28 Thread Mike Axiak
On Apr 28, 1:10 pm, Martin Diers <[EMAIL PROTECTED]> wrote: > [...] > > new_instance = True / False > > is the best solution. It solves the readability test, keeps backward   > compatibility, and prevents needless ambiguity which would ultimately   > lead to a dead function. Does it?

Re: #1443: strftime for date and datetime before 1900

2008-04-07 Thread Mike Axiak
On Mar 19, 10:07 pm, Philippe Raoult <[EMAIL PROTECTED]> wrote: > Hi everyone, > [...] > Anyway, the issue is that we have two different strategies for fixing > #1443(and two different patches): > 1. simply replace strtfime calls with custom format prints > 2. replace datetime by a specific

Re: django.contrib.sessions problems

2008-04-05 Thread Mike Axiak
Hey mrts, On Apr 5, 2:31 pm, mrts <[EMAIL PROTECTED]> wrote: > The cookies are already signed. Session data + > settings.SECRET_KEY is md5-digested and tampering raises an > exception. So in that sense the sessions are already secure. Sorry, I didn't mean "secure" in the sense that someone can

Re: Streaming Uploads Discussion

2008-04-04 Thread Mike Axiak
On Apr 4, 3:29 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > I admit I haven't been following this terribly closely, but now that > both #5361 and #2070 are nearing completion, I'm trying to get a good > handle on all of this in case there are any interactions between the > two that I can help

Re: Streaming Uploads Discussion

2008-04-04 Thread Mike Axiak
On Apr 4, 2:46 pm, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > Hrm, good point. I'll chew a bit more, but I can't think of a good way > to avoid the extra setting (as much as I dislike creeping settings). I didn't want to use the extra setting either, but I finally caved in after working

Re: Streaming Uploads Discussion

2008-04-04 Thread Mike Axiak
Thanks for the review! On Apr 4, 12:28 pm, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > >    TextFileForm(data={'description': u'Assistance'}, files={'file': > >  {'filename': 'test1.txt', 'content': 'hello world'}}) > > What would an equivalent line look like under the new system? That is,

Re: django.contrib.sessions problems

2008-04-03 Thread Mike Axiak
umably also need to require signed cookies for the session.) I would be interested to see what it would look like. Cheers, Mike Axiak --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers

Re: Streaming Uploads Discussion

2008-03-25 Thread Mike Axiak
On Mar 25, 3:38 pm, Mike Axiak <[EMAIL PROTECTED]> wrote: > Yes. :-) Doh. I didn't realize you actually wanted me to do more work. The newly updated doc can be found at the same URL: http://orodruin.axiak.net/upload_handling.html Be sure to refresh as the browser caching is high on

Re: Streaming Uploads Discussion

2008-03-25 Thread Mike Axiak
Hey, On Mar 25, 6:04 am, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > I don't like #1 because there's no point to keep deprecated code in > Django where we can fix it. And #3 is indeed broken because there is > much code in the wild that uses request.FILES directly. It's a public > API after all.

Re: Streaming Uploads Discussion

2008-03-24 Thread Mike Axiak
Now that we actually have a working patch [1], there are a few details I'd like to raise here. Major Issues === Supporting dictionaries in form code While we can have file objects that support the dictionary lookup to make those backwards compatible,

Re: Accessing request.FILES in chunks

2007-08-14 Thread Mike Axiak
Hello, I'm not entirely sure how Amazon S3 affects your situation, but #2070 is the only option I know of to chunk your files (i.e. to avoid loading the entire contents into memory). If you're using #2070, then the files that were successfully streamed will have a ['tmpfile'] attribute, which is

Re: Does SELECT 1 FROM... Work on SQL Server and Oracle?

2007-08-12 Thread Mike Axiak
If you're interested in performance, would it not also be wise to issue a LIMIT 1 at the end of the query if possible? I believe SELECT 1 will just return N 1s and the RDBMS will not stop searching simply because it found it. There are also some tickets to make checking the existence of a filter

Progress, status, and opinions of #2070

2007-05-22 Thread Mike Axiak
Hey Everyone, I've just posted what I believe is the cleanest version of ticket #2070 (that's file streaming uploads) yet. I wanted to break down what it does and ask the developers their opinions of each component. #2070 does everything in the core of django (no middleware, etc). There are a

Re: problems serving PDF file from view

2007-05-22 Thread Mike Axiak
that something can't be cached, you shouldn't be allowed to download it. I'm not sure this is a feature, but I'm not sure how obvious it is we want to "fix" it. -Mike On Apr 7, 5:57 pm, "SmileyChris" <[EMAIL PROTECTED]> wrote: > On Apr 6, 7:07 am, "Mike Axiak" <

Re: problems serving PDF file from view

2007-05-22 Thread Mike Axiak
ddleware prevents that, but it's not needed for a few simple cases. Hope this helps, Mike Axiak --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to d

Re: Edit inline in newforms-admin branch (ATTN: Joseph Kocherans)

2007-05-09 Thread Mike Axiak
/ticket/4255 Cheers, Mike Axiak On May 5, 5:19 pm, Jari Pennanen <[EMAIL PROTECTED]> wrote: > Modularity of edit inline? Any better? > > Currently: > models.ForeignKey(Other, edit_inline=models.TABULAR, parameters...) > obiviously is a big waste of OO abilities, > > instead

Best way to add hooks for file upload progress

2007-04-29 Thread Mike Axiak
Hey, Recently I've been working on #2070 (and its child ticket, #4165). After combing the sea of comments under #2070, I came across 27 (http://code.djangoproject.com/ticket/2070#comment:27), which mentions the idea of adding hooks for people to store file progress information and even yell to

Re: Model Equality Checking -- Does it need more power?

2007-04-26 Thread Mike Axiak
Hey, On Apr 26, 2:39 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > [...] > there isn't a consistent, automatic way to determine which columns to > exclude, an explicit function is going to be more useful. That's what the Meta field is for ;) Anyway, I don't think it's particularily

Re: Model Equality Checking -- Does it need more power?

2007-04-26 Thread Mike Axiak
to be changed (although it can be out of sync). -Mike On Apr 26, 1:57 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Hey Michael, > > > > On Wed, 2007-04-25 at 22:19 +, Mike Axiak wrote: > > Hello, > > > After some discussion in IRC I've written a patch to add

Model Equality Checking -- Does it need more power?

2007-04-25 Thread Mike Axiak
Hello, After some discussion in IRC I've written a patch to add an is_equal method to the models. (http://code.djangoproject.org/ticket/4157) However, there was some question over whether this should be named is_equal or __eq__. The current patch uses a Meta field to determine what fields

Re: Patch #2070 in trunk

2007-04-24 Thread Mike Axiak
I'm not the author, but I decided to play around and merged the changes that people suggested to the last patch (and got it working with SVN HEAD). If you'd like to play around and see if it works, please do. http://code.djangoproject.com/ticket/2070 -Mike On Apr 23, 3:30 pm, "[EMAIL

Re: Always loaded tempalte tags?

2007-04-24 Thread Mike Axiak
Please look at http://www.djangosnippets.org/snippets/160/. -Mike On Apr 24, 11:38 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > As someone who works with the Django template language eight+ hours a > day, I've built up quite a library of tags and filters that I use a > LOT. Like, in

Re: problems serving PDF file from view

2007-04-05 Thread Mike Axiak
't use any of the number of Django middleware that use Vary?). Cheers, Mike Axiak On Apr 5, 2:35 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi All, > > I found that Django can not serve PDF files from view, and I feel this > is wrong and must be fixed, so I tr

Re: Duplication of Postgres sequence values

2007-04-04 Thread Mike Axiak
If this does get reasonably fixed, can this be applied to 0.96.1? This is a bug-fix and the bug it fixes makes testing with fixtures (one of the 0.96's tauted features) a pain. -Mike Axiak On Apr 4, 8:42 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 4/4/07, J

Re: Q Objects and Joins

2007-02-28 Thread Mike Axiak
h with the where clauses the way they are, I think the LEFT OUTER JOINs patch I submitted WILL work, just not as well as it could.) -Mike On Feb 26, 5:18 pm, "Mike Axiak" <[EMAIL PROTECTED]> wrote: > Hello, > > Recently I've been working extensively with Q objects (that

Django's stance on adding filters to db core

2007-02-26 Thread Mike Axiak
and iregex. Thanks, Mike Axiak --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group,

Q Objects and Joins

2007-02-26 Thread Mike Axiak
haven't got a good name for it), will look up the tree (or down) for any ORs, and switch the join type from 'INNER JOIN' to 'OUTER JOIN'. I may have to overload QAnd and QOr as well. I was wondering, is there anything in the works like this? Are there better ways of doing this? Thanks, Mike Axiak