Re: Inconsistent keyword filtering on FK

2011-06-23 Thread Ian Clelland
ere's any practical difference in performance -- I would hope that any decent SQL query optimizer should be able to change select payee.* from payee join person on (payee.person_id = person.id) where person.id = 26 into select payee.* from payee where person_id = 26 -- Regards, Ian Clelland

Re: Strip_tags and non english char issue

2011-06-26 Thread Ian Clelland
If those aren't there, then your browser will have to guess the document encoding, and might be guessing wrong. Hopefully that should get you enough visibility on the problem to see what is happening. If none of that provides any clarity, then try posting those answers here, and someone mig

Re: Calling a custom templatetag inside a block/extrahead-block?

2011-07-04 Thread Ian Clelland
eived this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more o

Re: Calling a custom templatetag inside a block/extrahead-block?

2011-07-04 Thread Ian Clelland
eived this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more

Re: 'settings' referenced before assignment

2011-07-20 Thread Ian Clelland
the assignment to the 'settings' variable (if you don't), or change the name of the variable you assign to (if it was an accident). -- Regards, Ian Clelland -- You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Re: in my model, how can I tell when I'm saving a new item

2011-07-25 Thread Ian Clelland
th "manage.py loaddata", or by using fixtures in tests. If there is code that absolutely has to run when a new object is created, (or code that needs to run on update, but absolutely cannot run on new objects before insertion), then you may be better off using a post-save signal handler, a

Re: object value distinct for ForeignKey

2011-07-27 Thread Ian Clelland
nct to see why you might want to be writing testDB.objects.order_by().values('country').distinct() ) > > thanks in advance, > > Alfredo > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post

Re: object value distinct for ForeignKey

2011-07-27 Thread Ian Clelland
On Wed, Jul 27, 2011 at 9:29 AM, Ian Clelland wrote: > > > On Mon, Jul 25, 2011 at 11:29 AM, Alfredo Alessandrini < > alfreal...@gmail.com> wrote: > >> Hi, >> >> I've a model testDB with a foreignkey "country" related to another >

Re: How can I use {{variable}} in custom templatetag?

2011-08-08 Thread Ian Clelland
"Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/yYKP0Xoz9XkJ. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@goog

Re: How can I use {{variable}} in custom templatetag?

2011-08-08 Thread Ian Clelland
there isn't an easy solution for > these kind of queries. These kind of queries are pretty common to perform, > but how ??? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on th

Re: How can I use {{variable}} in custom templatetag?

2011-08-08 Thread Ian Clelland
r render() method is going to compute some value, probably a list of Entry instances in this case, and then it will create a new context variable, with the statement; context[self.related_entries] = And that is what is going to create the context variable {{related_entries}}, or {{cheeseburger_h

QuerySetManager breakage with r14389

2011-01-05 Thread Ian Clelland
Hi, I've been using Simon Willison's QuerySetManager[1] pattern for a while now, and since upgrading to Django 1.2.4, it has been breaking when I try to call a method on a RelatedManager constructed from it. There was a change in r14389 (14390 in the 1.2.X branch) which causes this code to break

Re: Ordering columns in from clause

2011-01-06 Thread Ian Clelland
his kind of query. It is not valid SQL to order by a column that is not in the result set. MySQL allows you to do that, but that is a MySQL-specific feature. PostgreSQL, certainly, does not allow this, and there is no real advantage gained (aside from a slightly smaller response) by excluding the or

Re: QuerySetManager breakage with r14389

2011-01-12 Thread Ian Clelland
On Wed, Jan 12, 2011 at 6:23 AM, Russell Keith-Magee wrote: > On Thu, Jan 6, 2011 at 5:29 AM, Ian Clelland wrote: >> Hi, >> >> I've been using Simon Willison's QuerySetManager[1] pattern for a >> while now, and since upgrading to Django 1.2.4, it has been br

Re: Generate a unique username for django.contrib.auth

2011-01-14 Thread Ian Clelland
ice from it should get you 120 bits of pure random goodness. -- Regards, Ian Clelland -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group,

Re: Query Set involving Model Method

2011-01-16 Thread Ian Clelland
se you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at >

Re: South introspection doesn't get registrered

2011-01-17 Thread Ian Clelland
MyFieldsDontWork > > Does anybody know why? Try changing the last line of your introspection rule, from > ["^core/.models/.lib.thumbs.ImageWithThumbsField",]) to something like ["^lib.thumbs.ImageWithThumbsField",]) It looks like South is not recognizing your field type, as it is using a different

Re: URLField strange error

2011-01-19 Thread Ian Clelland
URL Validator. Without some more info, this is all speculation anyway, though. Regards, Ian Clelland -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe f

Re: URLField strange error

2011-01-19 Thread Ian Clelland
ough a ModelForm, or are you saving the model manually? Regards, Ian Clelland -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from thi

Re: csrf cookie security

2011-02-09 Thread Ian Clelland
or not. (SSL wouldn't even help; he could construct an https:// link just as easily.) That's not how it's supposed to be set up, though. -- Regards, Ian Clelland -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: csrf cookie security

2011-02-09 Thread Ian Clelland
HTTP -- but the site is already HTTPS-only, so there shouldn't be any form-handling code listening on that port. Does this threat model correspond to what you're thinking? If so, I don't see away around the CSRF protection (at least, not one that involves the victim's browser)

Re: csrf cookie security

2011-02-10 Thread Ian Clelland
ername/password) are never sent in the clear, that your session cookie is never sent in the clear, and that essentially your whole site is protected by SSL, such that a request coming in over plain HTTP, even if properly authenticated, is still rejected. Once you have this in place, the secure flag o

Re: TemplateSyntaxError at /polls/updatepath/ Caught AttributeError while rendering: 'RawQuerySet' object has no attribute 'all'

2011-02-10 Thread Ian Clelland
rs+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Regards, Ian Clelland -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: TemplateSyntaxError at /polls/updatepath/ Caught AttributeError while rendering: 'RawQuerySet' object has no attribute 'all'

2011-02-11 Thread Ian Clelland
% for obj in my_raw_queryset %} {{ obj.visible_choice }} {% endfor %} -- Regards, Ian Clelland -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group

Re: User Profiles?

2011-02-15 Thread Ian Clelland
user object is different from saving the profile object. (user.save() just updates a row in the auth_user table, which doesn't affect the accounts_userprofile table at all.) The way I would do it is this: profile = user.get_profile() profile.age = 34 profile.save() Try that, and see if it update

Re: How to check if string is in Hebrew

2011-02-28 Thread Ian Clelland
nd then test all of the characters in the string, either with if any(map(char_is_hebrew, lang_string)): or if all(map(char_is_hebrew, lang_string)): -- Regards, Ian Clelland -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: How make CSRF middleware emit html4 rather than xhtml1.0 (closing tags issue) so will validate?

2011-03-14 Thread Ian Clelland
d, but more reusable way to do it would be to write your own template tag (it's really simple, you can use the CSRF-token code in django/template/defaulttags.py as a starting point) which would render whatever markup you need. -- Regards, Ian Clelland -- You received this message because you

Re: Repetition in urls.py

2011-03-24 Thread Ian Clelland
ate_by': > 10} Can you not set your info_dict just like that, and then rewrite it like this: YearArchiveView.as_view(**info_dict),name='blog_archive_year'), url(r'(?P\d{4})/(?P[a-z]{3})/$', -- Regards, Ian Clelland -- You received this message because you are s

Re: Seeking Django Counsel when adding a new model using South and a custom field for my ProtectedFileField subclass

2011-03-27 Thread Ian Clelland
ither: "student_portal\.fields\.ProtectedFileField" -- removing the "^" so that it can match anywhere within the string, or "^classcomm\.student_portal\.fields\.ProtectedFileField" -- preserving the "^", but adding the "classcomm." that South sees

Re: Using ifnotequal with a list object not working

2011-04-07 Thread Ian Clelland
ude" %} ... {% endifnotequal %} should work. -- Regards, Ian Clelland -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send ema

Re: Nested admin command problem

2011-04-07 Thread Ian Clelland
#x27; out of the options dictionary? def handle(self, *args, **options): self.host = options.pop('host') # 'host' isn't in options anymore # do some more stuff call_command('test', *args, **options) -- Regards, Ian Clelland -- You received this message

<    1   2