On Wed, 2008-11-19 at 18:21 -0800, John M wrote:
> I have a model with a custom model manager used for related set
> filtering, but it's not working as expected.
>
> See my models and test at http://dpaste.com/92327/
>
> Can someone explain why my manager isn't doing what I think it should?
OK I got the point but still having some problem dealing with excel
file.
code:
abspath = '/home/laspal/work/test/tmp/'
* view***
if not os.path.isdir(abspath + str(_user.username)):
os.mkdir(abspath + str(_user.username) )
filepathwithname =
On Wed, Nov 19, 2008 at 10:23 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
>
>
> On 20 nov, 06:01, "Brian Rosner" <[EMAIL PROTECTED]> wrote:
>> On Wed, Nov 19, 2008 at 9:53 PM, [EMAIL PROTECTED]
>>
>> <[EMAIL PROTECTED]> wrote:
>>
>> > I use a fake queryset because it's the only way that I
On 20 nov, 06:01, "Brian Rosner" <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 19, 2008 at 9:53 PM, [EMAIL PROTECTED]
>
> <[EMAIL PROTECTED]> wrote:
>
> > I use a fake queryset because it's the only way that I found to
> > populate the formset (using a real queryset would lead to the same
> >
Try:
ADMIN_MEDIA_PREFIX = 'http://media.mysite.org/media/'
Web site example always show just a path and not a site name, but
source code shows it can be full URL with site name.
# URL prefix for admin media -- CSS, JavaScript and images. Make sure
to use a
# trailing slash.
# Examples:
On Wed, Nov 19, 2008 at 9:53 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> I use a fake queryset because it's the only way that I found to
> populate the formset (using a real queryset would lead to the same
> problem anyway), hence I wonder if there is a cleaner way to do what I
> want
On 20 nov, 05:33, "Brian Rosner" <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 19, 2008 at 9:14 PM, [EMAIL PROTECTED]
>
>
>
> <[EMAIL PROTECTED]> wrote:
>
> > On 20 nov, 05:01, "Brian Rosner" <[EMAIL PROTECTED]> wrote:
> >> On Wed, Nov 19, 2008 at 8:59 PM, Brian Rosner <[EMAIL PROTECTED]> wrote:
>
On Wed, Nov 19, 2008 at 9:14 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> On 20 nov, 05:01, "Brian Rosner" <[EMAIL PROTECTED]> wrote:
>> On Wed, Nov 19, 2008 at 8:59 PM, Brian Rosner <[EMAIL PROTECTED]> wrote:
>> > On Wed, Nov 19, 2008 at 8:43 PM, Luper Rouch <[EMAIL PROTECTED]> wrote:
>>
On 20 nov, 05:01, "Brian Rosner" <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 19, 2008 at 8:59 PM, Brian Rosner <[EMAIL PROTECTED]> wrote:
> > On Wed, Nov 19, 2008 at 8:43 PM, Luper Rouch <[EMAIL PROTECTED]> wrote:
> >> For django to save the formset correctly when it is submitted, I have to
> >>
I think my prior response missed the mark in terms of sample html and
url.
To be precise:
http://mysite.org/admin/
yields the below html:
http://www.w3.org/1999/xhtml; lang="en-us" xml:lang="en-
us" >
Log in | Django site admin
<<<>>>
On Nov 19,
On Wed, Nov 19, 2008 at 8:59 PM, Brian Rosner <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 19, 2008 at 8:43 PM, Luper Rouch <[EMAIL PROTECTED]> wrote:
>> For django to save the formset correctly when it is submitted, I have to
>> manually set INITIAL_FORMS to 0 in javascript (because the objects are
On Wed, Nov 19, 2008 at 8:43 PM, Luper Rouch <[EMAIL PROTECTED]> wrote:
> For django to save the formset correctly when it is submitted, I have to
> manually set INITIAL_FORMS to 0 in javascript (because the objects are
> not really in the database).
It looks like you are trying to shove a
On Nov 19, 10:32 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Nov 20, 2:10 pm, "Serdar T." <[EMAIL PROTECTED]> wrote:
>
> > hmm...I modified the root as you suggested but still the same results:
> > I get the admin page minus any stylesheets, etc.
>
> > I'm confused though: what exactly
Hi,
I am running into an annoying problem when trying to create formsets
dynamically.
I have a script that sends JSON data to a view to render it as a
formset. The response is then inserted in the page:
Script:
data = JSON.stringify([1, 2, 3]);
$("#container").load("render-form/", {data:
On Nov 20, 2:10 pm, "Serdar T." <[EMAIL PROTECTED]> wrote:
> hmm...I modified the root as you suggested but still the same results:
> I get the admin page minus any stylesheets, etc.
>
> I'm confused though: what exactly is the ADMIN_MEDIA_PREFIX prefixing?
>
> It seems that the setting tacks
On Nov 20, 1:41 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > i know that django is not recommended to serve static content via
> > django and the web server handler should be used for it.
>
> > also, the following method to serve static content in development env,
hmm...I modified the root as you suggested but still the same results:
I get the admin page minus any stylesheets, etc.
I'm confused though: what exactly is the ADMIN_MEDIA_PREFIX prefixing?
It seems that the setting tacks "/media" to the end of root path as a
way of defining where the server
On Wed, Nov 19, 2008 at 9:30 PM, JimR <[EMAIL PROTECTED]> wrote:
>
> Karen,
>
> Thanks for the quick response, and sorry, I do have quotes around
> them, I just mistyped when I added them back in for the purposes of
> this post.
>
> Here's the abbreviated Team model, and the corrected Admin
[EMAIL PROTECTED] wrote:
> i know that django is not recommended to serve static content via
> django and the web server handler should be used for it.
>
> also, the following method to serve static content in development env,
> but not recommended in a production env.
>
>
maury wrote:
> Updates:
>
> I found some documentation and I added a code to urls.py like this :
>
> (r'^poll/add$', create_update.create_object, {'model' : Poll}),
>
> and the problem is that I have to write a template (I know where the
> file should be and how it should be named from the error
John,
Try checking the log output of the database server to see what is
different about the SQL. Perhaps some kind of caching is going on
where the manager is caching the results of it's queries?
On Thu, Nov 20, 2008 at 11:21 AM, John M <[EMAIL PROTECTED]> wrote:
>
> I have a model with a
Karen,
Thanks for the quick response, and sorry, I do have quotes around
them, I just mistyped when I added them back in for the purposes of
this post.
Here's the abbreviated Team model, and the corrected Admin Manager.
We do not have a __unicode__ method defined for the Team model.
I've
Malcolm Tredinnick wrote:
>
> On Mon, 2008-11-17 at 11:07 -0800, Gustavo Picón wrote:
> [...]
>> So the usual recommendation is:
>>
>> - if you're going to insert a lot more than you read, use adjacency
>> list
>> - if, as is the most common case, you're going to read your tree more
>> than
I have a model with a custom model manager used for related set
filtering, but it's not working as expected.
See my models and test at http://dpaste.com/92327/
Can someone explain why my manager isn't doing what I think it should?
Thanks
John
On Wed, 2008-11-19 at 18:06 -0800, stevedegrace wrote:
>
>
> On Nov 19, 12:04 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
> [...]
> > (5) Using reverse() is often a lot more explicit than a writing the URL
> > out in full. Which of these is more immediately readable?
> >
> >
Thank you Rajesh, your advice gave me the hints I needed. Much easier
than I thought it would be.
class FriendshipAdminForm(forms.ModelForm):
class Meta:
model = Friendship
def clean_to_friend(self):
if 'to_friend' in self.cleaned_data:
from_friend =
On Nov 19, 12:04 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
[...]
> (5) Using reverse() is often a lot more explicit than a writing the URL
> out in full. Which of these is more immediately readable?
>
> (a) /blog/archives/full-text/%s/ % (input1,)
>
> (b)
On Wed, 2008-11-19 at 15:46 -0800, ayayalar wrote:
> Hello,
>
> I am running into an issue with style sheets are not being found (404)
>
> Example:
>
> My Directory structure:
>
> C:\DJANGO\MYSITE2\TEMPLATES
> └───hello
> │ index.html
> │
> └───css
> base.css
>
On Wed, 2008-11-19 at 13:35 -0800, Silvano wrote:
> Dear all
>
> I'm completely stuck with the following problem.
>
> What I'm trying to accomplish is: I have an app with the model
> "Project" and another model "Contacts". In "Contacts" I have a m2m
> field called "projects_involved" relating
In case anyone runs across this, I've figure out A solution to this
problem. There's a class in django.forms.widgets called MultiWidget
that allows creating a widget that is composed of multiple other
widgets. So, I've copied what was done with
django.forms.widgets.SplitDateTimeWidget, and
On Wed, 2008-11-19 at 11:04 -0800, Luke Seelenbinder wrote:
> the models are:
>
> class Word(models.Model):
>... some stuff...
>
>class Meta:
>abstract=True
> class Noun(Word):
> .. some stuff ..
> class Verb(Word):
> ... some stuff ...
>
> code:
>
> nouns=
On Wed, 2008-11-19 at 17:46 +, Martin Green wrote:
> Thanks Rajesh,
>
> That should sort out my problem.
>
> As a side note, it seems 'base' and 'base__inherited' appear to do the
> same thing:
This is true because the SQL query is filtering on primary key values
and both the Base
On 19 Nov 2008, at 23:46, ayayalar wrote:
> I am running into an issue with style sheets are not being found (404)
I'm assuming you are using runserver in which case you need to set up
static file serving as per:
http://docs.djangoproject.com/en/dev/howto/static-files/
If you've already
On Wed, 2008-11-19 at 12:44 -0800, Nick wrote:
> Hi,
>
> I have the following strings which is run through the slugify filter
> on my site:
>
> "Business/Executives"
>
> and it becomes "businessexecutives". I'd like this to instead become
> "business-executives" (as they are actually two
On Wed, 2008-11-19 at 09:42 -0800, Delta20 wrote:
> A model field may have a 'choices' option to which you assign an
> iterable object -- typically a list, but this can also be an iterable
> function. Is there a way to assign a class method/function rather than
> a module function?
No. Python
If:
ADMIN_MEDIA_PREFIX = '/media/'
means that static media URLs will all be prefixed with that, then
wouldn't:
root /home/user/public_html/mysite/public/media;
need to be:
root /home/user/public_html/mysite/public;
This is because you have location '/' on nginx mapped to this
On Wed, 2008-11-19 at 00:34 -0800, Nicola Murino wrote:
[...]
> I would like to do something similar to this:
>
>
> def recursive(n,o1):
> nodes=Nodes.objects.select_related().filter(sublivello_di=n)
> o1=o1.filter(node=n)
> .
>
> for o in o1: #no db access I passed the
On Wed, 2008-11-19 at 21:24 +0900, Dominic Ashton wrote:
>
> Guys,
>
>
> Just had the strangest thing happened.
>
> Finished working on my project last night and everything was working
> fine. I backed up the directory using tar, log on today and start my
> development server and get the
Hello,
I am running into an issue with style sheets are not being found (404)
Example:
My Directory structure:
C:\DJANGO\MYSITE2\TEMPLATES
└───hello
│ index.html
│
└───css
base.css
nav.css
I have the following style sheet defined in the template html
Hello folks,
Can anyone out there offer advice on glitches in my production
environment, as well as explain the relevant settings.py in plain
English for a newbie?
I've been pulling my hair out for weeks trying to get an nginx reverse
proxy to serve static media while apache mod_wsgi serves up
I'm stuck on creating a custom widget for the admin interface and
wondering if anyone can help on where to look.
I've got a field which is essential a ForeignKey pointing to a State
model. In the admin interface I would like to show the current state
(done) and a list of the possible
On Wed, Nov 19, 2008 at 5:13 PM, JimR <[EMAIL PROTECTED]> wrote:
>
> We have defined the following models:
>
> class AbstractEvent(models.Model):
>team = models.ForeignKey(Team)
>description = models.TextField(null=True, blank=True)
>description_rendered =
Um, what about a regular python function which replaces '/' with '-'
then calls slugify
On 19 Nov 2008, at 20:44, Nick wrote:
>
> Hi,
>
> I have the following strings which is run through the slugify filter
> on my site:
>
> "Business/Executives"
>
> and it becomes "businessexecutives".
On Mon, Nov 17, 2008 at 10:00 PM, TeenSpirit83
<[EMAIL PROTECTED]> wrote:
>
> I'm writing an app with some italian zip and vat number fields and
> also a province select field
> can i force the admin class to validate the fields like
> class it.forms.ITVatNumberField
> class
Sounds like it could be easier to learn by building piecemeal from the
ground up than working through a dodgy set up.
Keep going to break through the initial stages of getting to grips
with Django, it'll reward you in the end.
On 19 Nov 2008, at 21:53, Bryan Oakley wrote:
>
> Thank you.
no answers!
i think there's no solution :(
how can i create my validation rules for those fields?
On 18 Nov, 01:00, TeenSpirit83 <[EMAIL PROTECTED]> wrote:
> I'm writing an app with some italian zip and vat number fields and
> also a province select field
> can i force the admin class to
We have defined the following models:
class AbstractEvent(models.Model):
team = models.ForeignKey(Team)
description = models.TextField(null=True, blank=True)
description_rendered = models.TextField(null=True, blank=True)
when = models.DateTimeField()
where
Thank you. That was certainly part of the problem. I also discovered I
needed to add django.contrib.auth. And oddly, a problem where I had an
admindocs (plural) directory but the admin site was looking for
admindoc (singular).
Eventually, with your help and some educated guesses I'm finally up
Dear all
I'm completely stuck with the following problem.
What I'm trying to accomplish is: I have an app with the model
"Project" and another model "Contacts". In "Contacts" I have a m2m
field called "projects_involved" relating to the "Project" model which
allows to select projects the
what happens when you go into the python interpreter and write
import basic
On 19 Nov 2008, at 16:58, goblue0311 wrote:
>
> I'm implementing the popular basic.blog application, which requires
> the inclusion of the basic.inlines project. However, I cannot seem to
> get my application to locate
installed apps needs 'django.contrib.sessions',
http://docs.djangoproject.com/en/dev/topics/http/sessions/#topics-http-sessions
On 19 Nov 2008, at 19:42, Bryan Oakley wrote:
>
> I inherited a django app and I'm trying to enable the admin interface
> without much luck. When I try to access the
Hi,
I have the following strings which is run through the slugify filter
on my site:
"Business/Executives"
and it becomes "businessexecutives". I'd like this to instead become
"business-executives" (as they are actually two seperate words).
I've tracked down the slugify filter to
I inherited a django app and I'm trying to enable the admin interface
without much luck. When I try to access the admin interface I see this
at the end of the error log:
OperationalError: no such table: django_session
Sure enough, it's not in my (sqlite) database. If I create a new
database
On Nov 19, 4:58 pm, goblue0311 <[EMAIL PROTECTED]> wrote:
> I'm implementing the popular basic.blog application, which requires
> the inclusion of the basic.inlines project. However, I cannot seem to
> get my application to locate the basic.inlines project. I have asked
> this question in the
Hi,
Try this,
http://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer
Hope this help
Chatchai
2008/11/19 seperelli <[EMAIL PROTECTED]>
>
> Dear,
> I have a site that is working with django,mysql,phyton on a linux
> system.
> This site should be put on a windows system where iis
the models are:
class Word(models.Model):
... some stuff...
class Meta:
abstract=True
class Noun(Word):
.. some stuff ..
class Verb(Word):
... some stuff ...
code:
nouns= Noun.objects.all()
verbs=Verb.objects.all()
words = verbs | nouns
I get an error saying: "Cannot
I'm implementing the popular basic.blog application, which requires
the inclusion of the basic.inlines project. However, I cannot seem to
get my application to locate the basic.inlines project. I have asked
this question in the basic.apps group, but I think it's generic enough
to be posted here
NetBeans for Python has been released and based on the NB Python
roadmap, it looks interesting for those of us working with Django. I
haven't had much of a chance to play with it yet since it just came
out today, but here's the info for anyone interested:
NetBeans IDE for Python:
Martin Green wrote:
> Thanks Rajesh,
>
> That should sort out my problem.
>
> As a side note, it seems 'base' and 'base__inherited' appear to do the
> same thing:
Yes, actually that should work too since inherited is an instance of
base. So, it's probably better to use 'base' since it's more
Thanks Rajesh,
That should sort out my problem.
As a side note, it seems 'base' and 'base__inherited' appear to do the
same thing:
>>> print Refered.objects.get(base__inherited=b).x
1
>>> print Refered.objects.get(base__inherited=i).x
2
>>> print Refered.objects.get(base=b).x
1
>>> print
A model field may have a 'choices' option to which you assign an
iterable object -- typically a list, but this can also be an iterable
function. Is there a way to assign a class method/function rather than
a module function?
Here's what I'm trying to do: I have a model, "Ticket" that can be in
Hi,
> I am trying to send an email to three people as follows:
>
> if request.session['Email'] != '':
> #initialize email variables
> # render both html and text strings from the templates below
> textmessage = render_to_string('email_text.html',
>
kevinski wrote:
> I'm currently going through the "Learning Website Dev with Django"
> book, using Django 1.0.2/Python 2.5/SQLite. There is an issue stumping
> me. The book includes a "friendship" model which includes 2 foreign
> keys set to User model:
>
> class Friendship(models.Model):
>
I've been seeing this same exact issue, even after completely deleting
and re-exporting Django and my project's source (minus all .pyc
files). It appears to be something else that's being buried by that
non-descriptive error message.
On Oct 1, 2:53 pm, hotani <[EMAIL PROTECTED]> wrote:
> It's
I'm currently going through the "Learning Website Dev with Django"
book, using Django 1.0.2/Python 2.5/SQLite. There is an issue stumping
me. The book includes a "friendship" model which includes 2 foreign
keys set to User model:
class Friendship(models.Model):
from_friend = models.ForeignKey(
On Nov 19, 12:11 am, "David Zhou" <[EMAIL PROTECTED]> wrote:
> It'll be helpful if you post the entire view, but well, like the error
> says, is form defined?
ah... i had it defined in another view and not in the current one...
many thanks.
I am trying to send an email to three people as follows:
if request.session['Email'] != '':
#initialize email variables
# render both html and text strings from the templates below
textmessage = render_to_string('email_text.html',
Thanks for your reply. That was really helpful. I still haven't
decided which approach I'm going to take, but that helps balance the
sides for me. I suppose it will be obvious which I should have done
when I pick something and see how it works out :P
On Nov 19, 12:04 am, Malcolm Tredinnick
Thanks Rajesh
i think i found the documentation therefore... Starting with inclusion
tags now :)
I'm pretty sure there will be more such basic questions and hope i can
ask them (and also get an answer)
_tia
On 19 Nov., 16:05, Rajesh Dhawan <[EMAIL PROTECTED]> wrote:
> > I'd like to build one
> yes..its just a transparent gif...i'm thinking of writing my
> own view, which will get the visitor data and then just call
> the static serve method provided by django. just dont know it
> its ok inproduction env though..
I'd be tempted to just serve this file like any other
static-media
Hi Martin,
> I have been trying to use inherited models and back references for
> filter queries, using django 1.0, 'final'. Whilst I am able to use
> back references for the base class, I can not do so for the inherited
> class (see example below). Is there any reasons why I should not be
>
On Nov 19, 12:55 am, "David Zhou" <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 19, 2008 at 1:54 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > yes..its just a transparent gif...i'm thinking of writing my own view,
> > which will get the visitor data and then just call the static serve
> >
> I'd like to build one component "Login" or "Navigation" which can be
> places on different templates at different palces. e.g.i'd like to
> have the the login component on the right side by default, but
> sometimes it should be in the content area.
>
> Till now i learend that i can repalce {%
Austin Gabel wrote:
[...]
> You can build a method that returns the link you want and add that to your
> list_display
Jarek Zgoda wrote:
[...]
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#list-display
>
> Additionally, set allow_tags=True property of the method returning link.
You can build a method that returns the link you want and add that to your
list_display
On Wed, Nov 19, 2008 at 8:15 AM, Fabio Natali
<[EMAIL PROTECTED]>wrote:
>
> Hi everybody!
>
> I need to customize the change list table of my admin page.
>
> I know I can use list_display to manage which
Hello
i just started over 2 days ago with python and django (although i have
some expirience in WebObejcts and Tomcat/JSP). I did the tutorial and
started building my first "app" :) and came to my first "bigger"
problem (perhaps understanding problem).
I'd like to build one component "Login" or
Wiadomość napisana w dniu 2008-11-19, o godz. 15:15, przez Fabio Natali:
> I know I can use list_display to manage which fields will show up in
> the table. The point is, I would like to add a column which is not a
> field of my model, but a link, specifically a different link for each
> row of
Hi everybody!
I need to customize the change list table of my admin page.
I know I can use list_display to manage which fields will show up in
the table. The point is, I would like to add a column which is not a
field of my model, but a link, specifically a different link for each
row of my
Dear,
I have a site that is working with django,mysql,phyton on a linux
system.
This site should be put on a windows system where iis is allready
running.
I installed phyton and i think i installed django as well. I made a
new virtual directory and copied the source files from the site.
Ad i
Hi,
I have been trying to use inherited models and back references for
filter queries, using django 1.0, 'final'. Whilst I am able to use
back references for the base class, I can not do so for the inherited
class (see example below). Is there any reasons why I should not be
able to do this?
The application I'm referring to uses CherryPy without any ORM. We
have a shortcut "execute" method that all DB calls go through. We just
added special exception handling to that call. Not sure how you would
do the same thing in Django. You'd probably have to dig into django.db
to see if you can
> Sometimes pages load well but sometimes I get "Internal Server Error"
> at the same URL. In this case I have to reload page once or twice to
> load it properly. I'm using FastCGI and after fault I can see the
> following message in the apache logs:
> "[error] [client 127.0.0.1] FastCGI:
If you need to work with trees then these projects might be worth
looking at:
http://code.google.com/p/django-treebeard/
http://code.google.com/p/django-mptt/
--
Maciej Wisniowski
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Try put:
# -*- coding: utf-8 -*-
in first line in .py file
Maybe you need change utf-8 to your encoding
Dominic Ashton pisze:
>
> Guys,
>
>
> Just had the strangest thing happened.
>
> Finished working on my project last night and everything was working
> fine. I backed up the directory using
Guys,
Just had the strangest thing happened.
Finished working on my project last night and everything was working fine. I
backed up the directory using tar, log on today and start my development
server and get the following error message:
Traceback (most recent call last):
File "manage.py",
Updates:
I found some documentation and I added a code to urls.py like this :
(r'^poll/add$', create_update.create_object, {'model' : Poll}),
and the problem is that I have to write a template (I know where the
file should be and how it should be named from the error message I
got) and I don't
Hi everyone. I'm new to Django and I followed the tutorial to
understand its basic mechanisms. I really like it :-)
I have to let the user insert records in the DB by a web-form. I
described the datum with a simple model and I want to use a generic
view to collect all the attributes from the
it works.
Thank you so much !
On Nov 19, 6:48 pm, "Alex Koshelev" <[EMAIL PROTECTED]> wrote:
> You have to convert value from string to integer:
>
> int(arg)
>
> On Wed, Nov 19, 2008 at 13:18, K*K <[EMAIL PROTECTED]> wrote:
>
> > I modified some code so I made mistake again. -_-#
>
> > The
You have to convert value from string to integer:
int(arg)
On Wed, Nov 19, 2008 at 13:18, K*K <[EMAIL PROTECTED]> wrote:
>
> I modified some code so I made mistake again. -_-#
>
> The right result looks like this:
>
> $ ./manage.py shell
> Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
>
I modified some code so I made mistake again. -_-#
The right result looks like this:
$ ./manage.py shell
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>
Sorry for my mistake, I wrote 'a' to test the code, if it's wrong I
hope it will report a error.
The corrected is here:
{{ people.name|cut_by_string:"10" }}
I run the code in the shell, it report right result to me, but I don't
know why it's not apply effect in the web page.
$ ./manage.py
On Nov 19, 9:52 am, "K*K" <[EMAIL PROTECTED]> wrote:
> Hi, All.
>
> I create a custom filter for cut too long string for my app.
>
> Like this:
>
> from django import template
> from django.template.defaultfilters import stringfilter
>
> register = template.Library()
>
>
Hi, All.
I create a custom filter for cut too long string for my app.
Like this:
from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter(name='cut_by_string')
@stringfilter
def cut_by_string(value, arg):
if
On 19 Nov, 01:33, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> On Tue, 2008-11-18 at 07:09 -0800, Nicola Murino wrote:
> > Hi all,
>
> > I read a lot of documentation about caching queryset but seems nothing
> > is useful for my purpose:
>
> > I have to load a treeview and so perform
94 matches
Mail list logo