r1-special1.html")
> c = Context( { "title":"Layer One Special One", "noun":"Stuff",
> "verb":"Django" } )
> print t.render(c)
>
> should print:
>
>
> Layer One Special One
>
> Header Stuff
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
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
e in datetime 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
#x27;t really understand why, but I'm sure there's a logical
> 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
t; filter? 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.djangopro
\Lib\site-packages\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 gr
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
an optional 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
--~--~-~--~~~---~--~~
Y
I'd like 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
--~--~-~--~~
{ 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 <, >
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
or some reason, but 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 G
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
>
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
aster, 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_divis
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
and Django's request
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 orde
ing 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/te
idea?
If it turns out that the only solution for your problem is to have
some fallback mechanism when including 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 can redirect both stdout 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 u
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 ent
t;> r.get_delivery_display()
> 3
>>>> 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_CHOIC
[the user has] changed robot")
I'm guessing you'll end up giving 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
--~--~-~--~~
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
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
>
> 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#s
ated against another 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 "sa
e, you 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
>
> 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 t
to the empty label (--) 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/n
torial[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
a in
a production 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" gro
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
--~--~-~--~~~---~--~-
h=20, 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 e
>
> 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
--~--~-
r the textareas:
>
> 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
--~--~-~--~--
:
>
> {{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
ocessors.request 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, se
k to
> the template.
If you have activated the request context processor, the request is
*automatically* passed to the template. (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:
{{ req
"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
--~--~-~--~~---
akes 3 arguments: self, request, url. There 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
committee_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@g
mes that don'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
--~--~-~--~~---
OICES = ( ('general', 'General enquiry'),
> ('bug', 'Bug report'),
> ('suggestion' 'Suggestion'),
> )
You're missing a comma in the last-but-one line. (It eva
OOT = "D:/test/mysite/mysite_media"
> MEDIA_URL = 'http://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 re
46 matches
Mail list logo