Well, Form.is_valid calculates the form and returns boolean, thats for sure.
Specifically, ">> from django import forms
>>>
>>> class F(forms.Form):
... name = forms.CharField()
...
>>> f = F()
>>> f.is_valid
>
>>> f.is_valid()
False
>>> f = F({'name': 'Lukasz'})
>>> f.is_valid()
True
You ge
At the time queryset is sliced Django actually fire the query and return
objects as normal python list.
Thats why your extra_context is 'static'.
Just slice latest_news / latest_pages at the template.
On Dec 22, 2009, at 12:47 PM, Francesco Benincasa wrote:
> * lunedì 21 dicembre 2009, alle 12
way?
On Dec 22, 2009, at 1:22 PM, Francesco Benincasa wrote:
> * martedì 22 dicembre 2009, alle 12:55, Łukasz Balcerzak scrive:
>> At the time queryset is sliced Django actually fire the query and return
>> objects as normal python list.
>> Thats why your extra_context is
ects passed through the "extra_context" parameter are not
> updated dinamically. The objects passed in the "queryset" are correctly
> updated.
>
> Thank you very much.
>
> * martedì 22 dicembre 2009, alle 15:00, Francesco Benincasa scrive:
>> * marted
Hi,
For relative paths, os.path module will do the trick - it is platform
independent. Use os.path's ``join``/``split`` methods and ``sep`` attribute. If
you are depending on absolute paths (which probably for both platforms would
just differ) you may simply call platform.system() and write a s
Hi,
First argument in ``patterns`` factory method is like the starting point
for all views that should be called. Moreover, you may pass function view
as a callable object or as a string but in this case your starting point
has to be hooked first.
So, if for instance, your view method 'firstsite'
Hi there,
Well, just try to make sure you are passing already saved instance (having
primary key set)
into related model which has foreign key to the first one.
Your approach:
> from test.models import A,B
> instA = A()
> instB = B(a=instA)
>
> Now I'm done with my parsing and am happy to save
Hi there,
I wonder if there is some easy and clean way of achieving this (hooking custom
admin views in urls
maybe is not that hard but definitely is not clean).
Let's assume we have simply model:
class Page(models.Model):
title = models.CharField(max_length=64)
author = models.Foreign
de and IMHO
> it's pretty clean.
>
>
> Xia Kai(夏恺)
> xia...@gmail.com
> http://blog.xiaket.org
>
> ------
> From: "Łukasz Balcerzak"
> Sent: Wednesday, December 30, 2009 7:23 PM
> T
Hi,
Python's parser use indentation to indicate logical blocks. Read more here:
http://www.secnetix.de/olli/Python/block_indentation.hawk
http://diveintopython.org/getting_to_know_python/indenting_code.html
http://docs.python.org/reference/lexical_analysis.html#indentation
You have 3 spaces befo
Hi there,
Well, it is quite simple but let's break it down:
> to me the command "from myproject.myapp.models import Author" should
> be
> either
>
>from myapp.models import Author
> or
>from models import Author # in the same folder as myapp.models.
1) If you use "from myapp.models imp
11 matches
Mail list logo