;>>> r.get_ui_display()
> 3
Just a guess: you're using some kind of *integer* model field but
since your choices are tuples with *strings* as the first element.
Use integers for the first element of each tuple instead:
RATING_CHOICES = (
(0, _('I don\'t know')),
(1, _('Ve
alue as user_points_value_t %}
... That's {{ user_points_value_t}} entry.
... {% plural %}
... That's {{ user_points_value_t}} entries.
... {% endblocktrans %}
... """)
>>> print t.render(Context({'user_points_value': 1})).strip()
That's 1 entry.
>>> print t.rende
tdout and stderr to a file like this:
set PYTHONPATH=E:\django runtests.py --settings=settings > results.txt 2>&1
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To p
ng templates, you could always
write a template tag to do just that. And maybe you can solve it
using some combination of template inheritance, inclusion and
select_template.
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Go
adding another template directory for the
> specific channel.
Have you seen the section on loading templates in the documentation?
It contains a tip that describes how you can use select_template to
nicely deal with this type of situation:
http://www.djangoproject.com/documentation/templat
quest
processing preserves this order when converting the encoded data to
MultiValueDicts.
> I'm trying to determine if I can do something the easy way (depend on
> the order as provided in the form) or do I have to name the fields in
> such a way to remember the order on POST.
You most like
ms/fields.py?rev=7859#L1104
Arien
--~--~-~--~~~---~--~~
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
r, but probably
> not enough to make much different in the real world.
Faster and more readable (imho):
>>> def make_divisible_by_4(num):
... div, mod = divmod(num, 4)
... return mod and (div + 1) * 4 or num
...
>>> make_divisible_by_4(8)
8
>>> make_divisible_by_4(
On Tue, Jul 15, 2008 at 2:08 PM, Arien <[EMAIL PROTECTED]> wrote:
> Oh, I see, you want the verbose_name of each field. I suppose you
> could write a templatetag that you could use like this:
>
> {% verbose_name layer.heating_temperature %}
> {{ layer.heating_temperature
On Tue, Jul 15, 2008 at 1:22 PM, Torsten Bronger
<[EMAIL PROTECTED]> wrote:
> Arien writes:
>> You'll have to make layer._meta.verbose_name available to the
>> template under some other name.
>
> Unfortunately, I use model polymorphism and model inheritance in
> thi
that doesn't seem to be the case.)
Why do you need to use HTML entities for accented characters? What is
the problem you're trying to solve?
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django use
On Tue, Jul 15, 2008 at 12:00 PM, Torsten Bronger
<[EMAIL PROTECTED]> wrote:
>
> Hallöchen!
>
> Arien writes:
>
>> On Tue, Jul 15, 2008 at 10:53 AM, Torsten Bronger
>> <[EMAIL PROTECTED]> wrote:
>>
>>> In a display template (not a form, just di
flatpage.content|escape }}
>
>
>
>
> I was expecting to see all accented chars in title and contents to be
> displayed properly escaped, however, I'm seing the "raw" chars. What am
> I doing wrong?
You can use the force_escape filter to escape <, >, quotes
to use the verbose_name of the model instance instead of
> hard-wiring the label in the template. How can I access it?
The verbose_name is at layer._meta.verbose_name. You can't access it
like that from your template, though.
Arien
--~--~-~--~~~---~--~
l attrs keyword argument (a
dictionary) for HTML attributes of the widget. The HTML attribute
you're looking for is maxlength:
some_field = forms.IntegerField(widget=forms.TextInput(attrs={'maxlength':
6}))
Arien
--~--~-~--~~~---~--~~
You received this mess
On Tue, Jul 15, 2008 at 9:58 AM, Arien <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 15, 2008 at 9:27 AM, Ralph <[EMAIL PROTECTED]> wrote:
>>
>> I'm trying to install django for the first time.
[...]
> What I do is this:
>
> 1. check out the svn version to some dire
ges\django.pth
which contains
c:\svn\django-trunk
(or whatever path you used in step 1.)
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
lter? For example, I
> want {{ var.date|date }} to format to {{ var.date|date:"l, F j Y" }}
> unless I specify otherwise, but still have the ability to format it
> differently in some cases. Is this possible?
Use the DATE_FORMAT setting:
http://www.djangoproject.
explanation!
The logical explanation is that adjusting the hour of a date doesn't
make sense, because a date doesn't have any hour. ;-)
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
ime then was only a date.
This shouldn't happen: a DateTimeField normalizes to a
datetime.datetime object. Are you sure you're not using a DateField
in your form?
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Grou
on/db-api/#deleting-objects
Arien
--~--~-~--~~~---~--~~
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, s
On Tue, Jul 15, 2008 at 2:06 AM, tom17 <[EMAIL PROTECTED]> wrote:
>
> Found out:
> id = models.AutoField(primary_key=True)
Or leave the id field out entirely. See:
http://www.djangoproject.com/documentation/model-api/#automatic-primary-key
1.html")
> c = Context( { "title":"Layer One Special One", "noun":"Stuff",
> "verb":"Django" } )
> print t.render(c)
>
> should print:
>
>
> Layer One Special One
>
> Header Stuff
>
>
/localhost:8080/mysite_media/'
This MEDIA_URL doesn't match what you've specified in your URLconf.
You'll want to pick one of the two.
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" g
= ( ('general', 'General enquiry'),
> ('bug', 'Bug report'),
> ('suggestion' 'Suggestion'),
> )
You're missing a comma in the last-but-one line. (It evaluates to the
concatenation of the two strings, so you get a sequence
on't use this header)
I think you'll find that the name the browser suggests is based on the
Content-Disposition header or something that looks like a file name at
the end of the URL (before the question mark and query string, if
any).
Arien
--~--~-~--~~~---~--~~
Y
ittee_type.list %}
{{ committee.name }}
{% endfor %}
{% endfor %}
{% endfor %}
Arien
--~--~-~--~~~---~--~~
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@google
re is no
> way to specify arguments in urls.py, so I have no idea how to fix
> this.
You want to capture the part of the path that' s "inside" your admin site:
(r'^admin/(.*)', site1.root)
This way the view gets its three arguments.
Arien
--~--~-~--~~-
;django.core.context_processors.media",
"django.core.context_processors.request",
)
There's more explanation about this in the docs here:
http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext
Arien
--~--~-~--~~~-
(That was the point of all
this, right?)
So to display the value of request.session['City'], for example, you'd
use this in your template:
{{ request.session.City }}
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goo
equest context processor, making sure
to always use a RequestContext when rendering the template.
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send emai
{{request.session["whatever"] }}
>
> but it says it can't parse the remainder...
Use the syntax of Django's template language:
{{ request.session.whatever }}
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
areas:
>
> class RandomEditForm( ModelForm ):
>description = HtmlField()
>
> Now the question is: where can I set the ROWS attribute for this
> Textarea?
See http://www.djangoproject.com/documentation/newforms/#specifying-widgets
Arien
--~--~-~--~~---
]
>
> Is the documention or the behavior wrong?
Neither. As explained in the docs "the form's data will be validated
the first time either you call is_valid() or access errors", see
http://www.djangoproject.com/documentation/newforms/#using-forms-to-validate-data
Arien
--~--~-~-
required=True,
> label = "Account #")
>
> i'm getting this:
>
> NameError: name 'request' is not defined
>
>
> how do i use a session variable for initial data?
You can pass in an "initial" argument when you instantiate your Form,
as explained here:
http:
On Fri, Jun 27, 2008 at 3:45 AM, Alessandro <[EMAIL PROTECTED]> wrote:
> So, it's possible to make a shortcut before my urls and generic views
> to record referrers data?
You could write some middleware to do just that.
Arien
--~--~-~--~~~---~--~~
duction setting. (For example, using Django's development
webserver or having DEBUG = True in your settings module.)
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
n tutorial[1] and the documentation for the os module[2].
Arien
[1] http://docs.python.org/tut/node9.html
[2] http://docs.python.org/lib/os-file-dir.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django u
-) shows up.
Ehhmm... Have you actually executed the code above? (You can't
"assign" to a form's fields like that.)
Anyway, you may want to read the documentation for newforms[1] and
ModelForms[2].
Arien
[1] http://www.djangoproject.com/documentation/newforms/
[2] http://www.djangoproje
>
> Yes, this is a recommendation, not a dogma. IMHO GET method is
> suitable for dense tables with dozens of operations.
Whether it's a good idea to use GET or not doesn't depend on
presentation issues.
Arien
--~--~-~--~~~---~--~~
You received this messag
want something like "filter the attractions in such
a way that the name of the city of the related event is ... and
eliminate duplicates in the resulting list":
attractions = Attraction.objects.filter(event__city__name='...').distinct()
The details depe
URI. This means that a POST
> request receiving a 307 should lead to another POST request with the
> same parameters (note: I'm not sure if you can ask for an alteration
> of the post parameters, but I doubt it)
If the request method is not "safe" (not GET or HEAD
t;
> I really wish it had some whitespace handling tools like Cheetah
> http://www.cheetahtemplate.org/docs/users_guide_html/users_guide.html#SECTION00068
Or Template Toolkit's:
http://template-toolkit.org/docs/manual/Syntax.html#section_Cho
ch=Movado+Watches
> http://www.jewelerslounge.com
> http://www.goldwatches.com
^^^^^
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post t
On Fri, May 9, 2008 at 7:28 AM, Matt Davies <[EMAIL PROTECTED]> wrote:
> What's the best method of keeping the django_sessions table from growing so
> large?
Well, there's django/bin/daily_cleanup.py ;-)
Arien
--~--~-~--~~~---~--~~
You received
iving your models verbose names in the
accusative ("robota") instead of in the nominative ("robot")... But
at least it will be pretty on the outside.
Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed t
46 matches
Mail list logo