Re: Bug? Related manager not working for custom manager?

2008-11-19 Thread Malcolm Tredinnick
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?

Re: File field problem

2008-11-19 Thread laspal
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 =

Re: Creating formsets through AJAX

2008-11-19 Thread Brian Rosner
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

Re: Creating formsets through AJAX

2008-11-19 Thread [EMAIL PROTECTED]
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 > >

Re: configuring production server for static media

2008-11-19 Thread Graham Dumpleton
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:

Re: Creating formsets through AJAX

2008-11-19 Thread Brian Rosner
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

Re: Creating formsets through AJAX

2008-11-19 Thread [EMAIL PROTECTED]
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: >

Re: Creating formsets through AJAX

2008-11-19 Thread Brian Rosner
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: >>

Re: Creating formsets through AJAX

2008-11-19 Thread [EMAIL PROTECTED]
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 > >>

Re: configuring production server for static media

2008-11-19 Thread Serdar T.
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,

Re: Creating formsets through AJAX

2008-11-19 Thread Brian Rosner
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

Re: Creating formsets through AJAX

2008-11-19 Thread Brian Rosner
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

Re: configuring production server for static media

2008-11-19 Thread Serdar T.
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

Creating formsets through AJAX

2008-11-19 Thread Luper Rouch
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:

Re: configuring production server for static media

2008-11-19 Thread Graham Dumpleton
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

Re: serving static file via django

2008-11-19 Thread Graham Dumpleton
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,

Re: configuring production server for static media

2008-11-19 Thread Serdar T.
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

Re: Help with Abstract class and admin.py

2008-11-19 Thread Karen Tracey
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

Re: serving static file via django

2008-11-19 Thread Steve Holden
[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. > >

Re: Using generic view to insert a simple model in the DB

2008-11-19 Thread Steve Holden
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

Re: Bug? Related manager not working for custom manager?

2008-11-19 Thread Ian Lewis
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

Re: Help with Abstract class and admin.py

2008-11-19 Thread JimR
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

Re: Items tree in Django

2008-11-19 Thread Steve Holden
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

Bug? Related manager not working for custom manager?

2008-11-19 Thread John M
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

Re: Reverse mapping URLs: why?

2008-11-19 Thread Malcolm Tredinnick
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? > > > >

Re: Many to One - Requriring 2 fields to be different

2008-11-19 Thread kevinski
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 =

Re: Reverse mapping URLs: why?

2008-11-19 Thread stevedegrace
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)

Re: referencing style sheets in templates

2008-11-19 Thread Malcolm Tredinnick
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 >

Re: Filtered choices list for a m2m field from an m2m field within another model.

2008-11-19 Thread Malcolm Tredinnick
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

Re: Select Date Time Widget

2008-11-19 Thread brad
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

Re: Combine QuerySets from two different child models

2008-11-19 Thread Malcolm Tredinnick
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=

Re: Back references for inherited models in Django 1.0

2008-11-19 Thread Malcolm Tredinnick
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

Re: referencing style sheets in templates

2008-11-19 Thread Andy McKay
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

Re: Customising slugify filter

2008-11-19 Thread Malcolm Tredinnick
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

Re: dynamic choices iterator in model field

2008-11-19 Thread Malcolm Tredinnick
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

Re: configuring production server for static media

2008-11-19 Thread Graham Dumpleton
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

Re: caching queryset for filtering

2008-11-19 Thread Malcolm Tredinnick
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

Re: Non-ASCII character - strange error

2008-11-19 Thread Malcolm Tredinnick
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

referencing style sheets in templates

2008-11-19 Thread ayayalar
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

configuring production server for static media

2008-11-19 Thread Serdar T.
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

New custom field and widget for admin

2008-11-19 Thread Andy McKay
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

Re: Help with Abstract class and admin.py

2008-11-19 Thread Karen Tracey
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 =

Re: Customising slugify filter

2008-11-19 Thread Ben Eliott
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".

Re: validate fields in the admin as some local flavor form fields

2008-11-19 Thread Ramiro Morales
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

Re: problem enabling the admin interface

2008-11-19 Thread Ben Eliott
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.

Re: validate fields in the admin as some local flavor form fields

2008-11-19 Thread TeenSpirit83
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

Help with Abstract class and admin.py

2008-11-19 Thread JimR
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

Re: problem enabling the admin interface

2008-11-19 Thread Bryan Oakley
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

Filtered choices list for a m2m field from an m2m field within another model.

2008-11-19 Thread Silvano
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

Re: Django template tag question

2008-11-19 Thread Ben Eliott
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

Re: problem enabling the admin interface

2008-11-19 Thread Ben Eliott
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

Customising slugify filter

2008-11-19 Thread Nick
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

problem enabling the admin interface

2008-11-19 Thread Bryan Oakley
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

Re: Django template tag question

2008-11-19 Thread Daniel Roseman
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

Re: Moving django site from linux to windows

2008-11-19 Thread Chatchai Neanudorn
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

Combine QuerySets from two different child models

2008-11-19 Thread Luke Seelenbinder
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

Django template tag question

2008-11-19 Thread goblue0311
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 IDE for Python

2008-11-19 Thread Delta20
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:

Re: Back references for inherited models in Django 1.0

2008-11-19 Thread Rajesh Dhawan
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

Re: Back references for inherited models in Django 1.0

2008-11-19 Thread Martin Green
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

dynamic choices iterator in model field

2008-11-19 Thread Delta20
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

Re: sending emails to multiple people

2008-11-19 Thread Rajesh Dhawan
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', >

Re: Many to One - Requriring 2 fields to be different

2008-11-19 Thread Rajesh Dhawan
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): >

Re: Django new comments framework error

2008-11-19 Thread Greg Taylor
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

Many to One - Requriring 2 fields to be different

2008-11-19 Thread kevinski
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(

Re: form issue

2008-11-19 Thread Bobby Roberts
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.

sending emails to multiple people

2008-11-19 Thread Bobby Roberts
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',

Re: Reverse mapping URLs: why?

2008-11-19 Thread stevedegrace
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

Re: building components

2008-11-19 Thread ReneMarxis
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

Re: serving static file via django

2008-11-19 Thread Tim Chase
> 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

Re: Back references for inherited models in Django 1.0

2008-11-19 Thread Rajesh Dhawan
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 >

Re: serving static file via django

2008-11-19 Thread varikin
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 > >

Re: building components

2008-11-19 Thread Rajesh Dhawan
> 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 {%

Re: Custom column in admin change list table

2008-11-19 Thread Fabio Natali
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.

Re: Custom column in admin change list table

2008-11-19 Thread Austin Gabel
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

building components

2008-11-19 Thread ReneMarxis
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

Re: Custom column in admin change list table

2008-11-19 Thread Jarek Zgoda
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

Custom column in admin change list table

2008-11-19 Thread Fabio Natali
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

Moving django site from linux to windows

2008-11-19 Thread seperelli
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

Back references for inherited models in Django 1.0

2008-11-19 Thread martin
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?

Re: MySQL deadlocking issues

2008-11-19 Thread DavidA
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

Re: "Segmentation Fault" (mod_python) and "incomplete headers (0 bytes)..." (FastCGI)

2008-11-19 Thread Pigletto
> 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:

Re: caching queryset for filtering

2008-11-19 Thread Pigletto
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

Re: Non-ASCII character - strange error

2008-11-19 Thread Sebastian Bauer
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

Re: Non-ASCII character - strange error

2008-11-19 Thread Dominic Ashton
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",

Re: Using generic view to insert a simple model in the DB

2008-11-19 Thread maury
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

Using generic view to insert a simple model in the DB

2008-11-19 Thread maury
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

Re: Template custom filter doesn't work

2008-11-19 Thread K*K
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

Re: Template custom filter doesn't work

2008-11-19 Thread Alex Koshelev
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) >

Re: Template custom filter doesn't work

2008-11-19 Thread K*K
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) >>>

Re: Template custom filter doesn't work

2008-11-19 Thread K*K
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

Re: Template custom filter doesn't work

2008-11-19 Thread Daniel Roseman
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() > >

Template custom filter doesn't work

2008-11-19 Thread K*K
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

Re: caching queryset for filtering

2008-11-19 Thread Nicola Murino
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