Malcolm Tredinnick wrote:
> Hey Gary,
>
> On Tue, 2008-01-08 at 00:35 -0600, Gary Wilson Jr. wrote:
> [...]
>> So, looking at a couple places in Django trunk where response.content is
>> used,
>> these look like bugs:
>>
>>
>> django.contrib
Malcolm Tredinnick wrote:
> On Mon, 2008-01-07 at 18:28 -0600, Gary Wilson Jr. wrote:
>> Malcolm Tredinnick wrote:
>>> On Sun, 2008-01-06 at 15:25 -0600, Gary Wilson Jr. wrote:
>>>> It appears that at this point, response.content is a utf8-encoded
>
Malcolm Tredinnick wrote:
> On Sun, 2008-01-06 at 15:25 -0600, Gary Wilson Jr. wrote:
>> It appears that at this point, response.content is a utf8-encoded bytestring.
>> I'm playing with a response middleware doing something like:
>>
>> MY_RE.sub(u'%s' % text, response.
It appears that at this point, response.content is a utf8-encoded bytestring.
I'm playing with a response middleware doing something like:
MY_RE.sub(u'%s' % text, response.content)
which raises a UnicodeDecodeError if response.content contains non-ascii.
I understand that the strings need to
On Aug 30, 3:08 am, Ilya Semenov <[EMAIL PROTECTED]> wrote:
> Second, I think the use of generic views is over-estimated.
I tend to agree a bit here. I like having all my URLs in one file and
all my views in another. Using generic views usually clutters the
urls file too much for me. Generic
On Jul 26, 1:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> In my view, I have:
> future_events = Event.objects.filter(start_date__gte=now)
> pacific_events = future_events.filter(club__region='Pacific')
> rocky_mountain_events = future_events.filter(club__region='Rocky
>
On Mar 29, 2:26 pm, "Milan Andric" <[EMAIL PROTECTED]> wrote:
> But in the dev environment I can see pretty well that the view is
> functioning very quickly. So your hunch about the problem lying in
> the templates is probably right.
If you aren't seeing the slowdown on your dev server, then
Starting to play around with newforms and I am trying to create a form
with fewer fields than the model and post-fill those fields in the view.
With the following example models and form:
class Book(models.Model):
author = models.CharField(maxlength=100, blank=True)
title =
On Feb 18, 10:48 am, "Honza Král" <[EMAIL PROTECTED]> wrote:
> On 2/18/07, Tom? Pokorn? <[EMAIL PROTECTED]> wrote:
>
> > models.py attached.
>
> > On Sun, 2007-02-18 at 16:51 +0100, Honza Kr?l wrote:
>
> > > that's odd can you post your Model definition?
>
> definitely odd, list_select_related
I've got a FieldField using the RequiredIfOtherFieldNotGiven validator,
and when I try to save the object without filling in the "other field,"
I get two duplicate error messages above the file upload box. I assume
this has something to do with FileField really using two form field
widgets, but
Malcolm Tredinnick wrote:
> When you have models in a deeper structure like this, you need to
> explicitly tell the model what the app name is. You do this as follows:
>
> class SimpleTest(models.Model):
> ...
> class Meta:
> app_label="appfolder"
>
>
[EMAIL PROTECTED] wrote:
> File "/usr/lib/python2.4/site-packages/django/views/debug.py", line
> 144, in technical_404_response
> t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template')
>
> TypeError: __init__() got an unexpected keyword argument 'name'
>
Malcolm Tredinnick wrote:
> On Tue, 2006-08-29 at 03:53 +0000, Gary Wilson wrote:
> > I see that there is a _get_sql_clause() method, but is there a function
> > that will return the constructed query string?
>
> Deja vu. I tried to implement something like this a little wh
Ivan Sagalaev wrote:
> Gary Wilson wrote:
> > Why can't objects be used in python sets? Example:
> >
> >>>> [u.username for u in User.objects.all()]
> > ['bar', 'foo', 'foobar']
> >>>> a = User.objects.filter(username__contains='foo')
>
Why can't objects be used in python sets? Example:
>>> [u.username for u in User.objects.all()]
['bar', 'foo', 'foobar']
>>> a = User.objects.filter(username__contains='foo')
>>> b = User.objects.filter(username__contains='bar')
>>> set.intersection(set(a), set(b))
set([])
but...
>>> a
[, ]
[EMAIL PROTECTED] wrote:
> > def tags(request, url):
> > # Don't need the last item in the list since it will
> > # always be an empty string since Django will append
> > # a slash character to the end of URLs by default.
> > tags = url.split('/')[:-1]
> > posts =
I see that there is a _get_sql_clause() method, but is there a function
that will return the constructed query string?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
Andres Luga wrote:
> when displaying a form for a new object, I'm trying to set a default
> value for a date field using a filter in a template, like so:
>
>
> {{ form.somefield|date:"Y-m-d" }}
>
> This gives me an error:
> 'FormFieldWrapper' object has no attribute 'year'.
> What am I doing
[EMAIL PROTECTED] wrote:
> Hello -
>
> I'm playing around with a blog application and I want it to have a
> tagging feature. I have the usual ManyToMany relationship set up with
> Post and Tag (I'm not going to past my model since I think everyone is
> familiar with this kind of setup).
>
> I
> Hence, I've put a list of users into my 'auth/sql/User.sql' file, but
> ./manage.py syncdb doesn't seem to pick up the existence of the file.
> I have no doubt it's in the wrong place, but my question is which is
> the correct place? :-)
I think the file needs to be placed at
cyberco wrote:
> I want to limit a view to certain group members, so I'm using the
> following decorator:
>
> @user_passes_test(lambda u: Group.objects.get(name='admin') in
> u.groups.all(), login_url='/accounts/login/')
>
> This seems a little verbose. Is there a better way?
user_passes_test is
[EMAIL PROTECTED] wrote:
> i imported 2 users in the model LoginInfo the first is lab_id = '100'
> and the second is lab_id = '200'
> how do i put in the data in the class Modules ?
>
> what i thought i had to do was first create a object from the LoginInfo
> class like
> p =
Adrian Holovaty wrote:
> You're best off searching by the exact fields rather than messing with
> derived fields.
Would you offer some insight please?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
Adrian Holovaty wrote:
> On 5/23/06, Gary Wilson <[EMAIL PROTECTED]> wrote:
> > Yes, I guess I could split the text entered and then do a search for
> > each word in both first_name and last_name like the admin interface
> > does... just seems like this would return ma
Waylan Limberg wrote:
> For an example of how the admin app does this see search_fields
> http://www.djangoproject.com/documentation/model_api/#search-fields
>
> --
>
> Waylan Limberg
> [EMAIL PROTECTED]
Yes, I guess I could split the text entered and then do a search for
each word in both
calculated full name in the database)?
Something like...
User.objects.filter(get_full_name__iequals="Gary Wilson")
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
26 matches
Mail list logo