Re: Paginator Overhall

2006-10-12 Thread Malcolm Tredinnick
Hi Ian, On Thu, 2006-10-12 at 13:11 -0700, sago wrote: > All, > > I filed a bug in paginator last week. SmileyChris pointed out that his > extra-features patch would solve the bug, and add orphan control (so > you don't get one post on its own page at the end). > > I've got a pimped-up version

Re: Caching with cache middleware disabled?

2006-10-12 Thread Malcolm Tredinnick
On Wed, 2006-10-11 at 23:49 +, [EMAIL PROTECTED] wrote: > Hi everyone, > > I'm experiencing some problems on an application I did. Basically, it's > just a tiny blog application, deployed on an Apache+mod_python server. > > The problem is that whenever I add a new post, it doesn't show in th

Re: more fun with custom fields

2006-10-12 Thread Malcolm Tredinnick
On Thu, 2006-10-12 at 17:11 -0400, [EMAIL PROTECTED] wrote: > ok, I made this change to the Model.__init__() method. at the very end: > > for i, arg in enumerate(args): > + if hasattr(self._meta.fields[i], 'translate_from_db') and arg: > + arg = self._meta.fields[i

Re: Birthday

2006-10-12 Thread Kenneth Gonsalves
On 13-Oct-06, at 3:54 AM, Guillermo Fernandez Castellanos wrote: > I am trying to keep a birthday field in the database. But i am only > interested in the day and month. Is there a way of using a DateField > but only with day and month fields? Or should I use another solution? store it as DateF

Re: Birthday

2006-10-12 Thread Julio Nobrega
You could use an SmallInteger field and store MMDD... or use a date field and default they Year value to some number, like 2000... On 10/12/06, Guillermo Fernandez Castellanos <[EMAIL PROTECTED]> wrote: > > Hi, > > I am trying to keep a birthday field in the database. But i am only > intereste

Re: 'bool' object has no attribute 'get' ??

2006-10-12 Thread Russell Keith-Magee
On 10/7/06, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote: > > Nicolas Steinmetz wrote: > > > class Comment(models.Model): > > author = models.CharField(maxlength=50) > > email = models.EmailField() > > title = models.CharField(maxlength=50) > > comment = models.TextField() > > p

Birthday

2006-10-12 Thread Guillermo Fernandez Castellanos
Hi, I am trying to keep a birthday field in the database. But i am only interested in the day and month. Is there a way of using a DateField but only with day and month fields? Or should I use another solution? Thanks, G --~--~-~--~~~---~--~~ You received this m

Re: Extending a template - error

2006-10-12 Thread MerMer
I've now got the TEMPLATE_DIR as 'mytemplates' and that's fixed it. Your advice on what is an absolute and relative path was very helpful. Many thanks. Based on the above, could you give me some examples on what my Media Root and URL, and Admin Media Prefix should be. I think I'm also having is

Re: 'bool' object has no attribute 'get' ??

2006-10-12 Thread Nicolas Steinmetz
Anyone has an idea about this as I would like to set this key so that I can have threaded comments. Otherwise what would you suggest me to implement threaded comments ? Nicolas Nicolas Steinmetz wrote: > > Hello, > > I have the following code but I do not understand why I have the error > be

Re: more fun with custom fields

2006-10-12 Thread bfordham
ok, I made this change to the Model.__init__() method. at the very end: for i, arg in enumerate(args): + if hasattr(self._meta.fields[i], 'translate_from_db') and arg: + arg = self._meta.fields[i].translate_from_db(arg) setattr(self, self._meta.fields[i

Testing for Membership Across Relations

2006-10-12 Thread samuraisam
Alright, so this is my third day with Django, and I am kind of stuck. I'm trying to test for membership objects across relations in a lookup. Hopefully that makes sense. O.o I'm using the basic User model. I have a Friend model which makes two ForeignKeys to User: class Friend(models.Model):

Re: Extending a template - error

2006-10-12 Thread Don Arbow
On Oct 12, 2006, at 12:29 PM, MerMer wrote: > > Don, > > Thanks for the advice - but it's not working for me. > > My full path is > "c:/python24/lib/site-packages/django/bin/mysite/mytemplates" which > works. > > I've tried "/mytemplates" and "mysite/mytemplates" as the TEMPLATE_DIR > path but the

Re: Manually setting an ImageField gives a SQL error

2006-10-12 Thread Corey Oordt
Thanks for the tip, I am using os.path.splitext() ! I think somehow the problem lies with psycopg and it's "auto-quoting" feature. I'm not sure how it figures out what needs to be quoted and what doesn't. Thanks for the help, RajeshD! Corey On Oct 12, 2006, at 4:07 PM, RajeshD wrote: > >

Paginator Overhall

2006-10-12 Thread sago
All, I filed a bug in paginator last week. SmileyChris pointed out that his extra-features patch would solve the bug, and add orphan control (so you don't get one post on its own page at the end). I've got a pimped-up version of paginator too, and judging from searches, it seems like lots of fol

Re: Manually setting an ImageField gives a SQL error

2006-10-12 Thread RajeshD
> > UPDATE "addocs_document" SET > "doctype"=2,"ad_id"='123456',"height"=0,"width"=0,"image"=ad_document > s/2006/10/12/123456_2_8..pdf,"submitted"='2006-10-12 > 12:43:24',"received"='2006-10-12 12:57:12.155 598' WHERE "id"=8 > > As you can see in the UPDATE statement, it is relative to the > MEDI

Re: Manually setting an ImageField gives a SQL error

2006-10-12 Thread RajeshD
> > UPDATE "addocs_document" SET > "doctype"=2,"ad_id"='123456',"height"=0,"width"=0,"image"=ad_document > s/2006/10/12/123456_2_8..pdf,"submitted"='2006-10-12 > 12:43:24',"received"='2006-10-12 12:57:12.155 598' WHERE "id"=8 > > As you can see in the UPDATE statement, it is relative to the > MEDI

Re: Choosing a format for built-in comments

2006-10-12 Thread Waylan Limberg
On 10/12/06, Tool69 <[EMAIL PROTECTED]> wrote: > > Hi, > I've made a little blog app, but i'm not satisfied with django's > free-comment. You'll find a nice writeup on hacking free-comment here [1]. That article doesn't address your concern exactly, but should familiarize you with the code and gi

About to invest in Django/Python in a Big Way..

2006-10-12 Thread [EMAIL PROTECTED]
I've been a python dev since 2000 and Django since 2005. I've evaluated the alternatives for several years now (including Ruby/Rails and Python/Quixote which are still cool) and just cannot avoid the conclusion that Django is the place to be for serious SOA development. Well I find myself at a

Re: When to

2006-10-12 Thread MerMer
Frankie, Thanks for this... I'll take a look. MerMer --~--~-~--~~~---~--~~ 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 thi

Re: Extending a template - error

2006-10-12 Thread MerMer
Don, Thanks for the advice - but it's not working for me. My full path is "c:/python24/lib/site-packages/django/bin/mysite/mytemplates" which works. I've tried "/mytemplates" and "mysite/mytemplates" as the TEMPLATE_DIR path but they don't. The {% extends "promotion_list.htmt"%} is not working

Re: writing templatetag in database?

2006-10-12 Thread Waylan Limberg
On 10/11/06, patrickk <[EMAIL PROTECTED]> wrote: > > waylan, although I don´t understand your last/second suggestion, I > managed to store my templates in the database. > if you think your second suggestion is by far better than the first > one ... could you please explain it again. > > my current

Re: Manually setting an ImageField gives a SQL error

2006-10-12 Thread Corey Oordt
Here is the stack trace: --- psycopg.ProgrammingError Traceback (most recent call last) /home/django_dev/pennysaver/ /home/django_dev/pennysaver/addocs/processworkflows.py in start_check_workf

Re: Manually setting an ImageField gives a SQL error

2006-10-12 Thread RajeshD
> The sve() method gives an error tracing back to the UPDATE statement. Usually it helps get you better responses, if you include the actual stack trace. > In the statement the 'image' field looks like > "image"=/path/to/the/file.ext, ... > > What is the proper method to set this field? The Ima

Re: Filter QuerySet using Manager

2006-10-12 Thread samuraisam
Thanks, Malcom. I think I figured out what I need to do: if request.user.is_anonymous(): return posts which are marked "public" (easy) if request.user.is_logged_in(or whatever the method is): return posts which are marked "protected" (easy) also return posts which are marked "restricted" (

Re: Filter QuerySet using Manager

2006-10-12 Thread samuraisam
Another question: how can I check if a related field contains something? Thanks, Sam --~--~-~--~~~---~--~~ 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@googlegro

Re: Accessing session variables in templates

2006-10-12 Thread patrickk
I didn´t try that, but with a combination of the following it should work: http://www.djangoproject.com/documentation/request_response/#attributes http://www.djangoproject.com/documentation/templates_python/#django- core-context-processors-request patrick Am 12.10.2006 um 19:21 schrieb Patr

Manually setting an ImageField gives a SQL error

2006-10-12 Thread Corey
I'm writing an app that gathers images from other file sources and puts them into a database. To do this I have a model with an ImageField. When I set the field to the filename, it doesn't quote it in the resulting SQL passed to the backed. Here is what I'm doing, exactly: doc.image = os.pa

Accessing session variables in templates

2006-10-12 Thread Patrick J. Anderson
Hi! I have a member_id session variable, which I set at login (it is different than "user"). I need to check that variable in my templates to display member-specific navigation. How can I check do this? Or do I need to do the checking in each view function and pass the value in a template va

Re: Adding a custom field for ManyToMany

2006-10-12 Thread Ramiro Morales
Ceph, On 10/10/06, Ceph <[EMAIL PROTECTED]> wrote: > > I seem to recall some documentation somewhere, but it appears I was > hallucinating because I can't find it again. > > Is there a way to add custom field in a Django ManyToMany > relationship? Example has two models, Article and Category. An

Re: Extending a template - error

2006-10-12 Thread Don Arbow
On Oct 12, 2006, at 8:03 AM, MerMer wrote: > > my settings look like the following:- > > TEMPLATE_DIRS = ( > "c:/python24/lib/site-packages/django/bin/mysite/mytemplates", > > When I set up Django I just put in the full path in the belief that > this would make things easier while I was testin

Re: Extending a template - error

2006-10-12 Thread MerMer
Julio, I not sure what directory you're refering to. The tutorial is quite explicit that one should create your own template directory within your site. It wouldn't make any sense if these then had to refer to base templates elsewhere. MerMer --~--~-~--~~~---~--~-

Search in generic views

2006-10-12 Thread ElGranAzul
Hi, i'm developing an application and i need a search function like admin search in some models. I've tryed modifying generic views, but i can't make it work. The idea is something like: [ CODE ] def object_list([...] search_fields=None, q=None [...]): """ [...] search_fields

Adding a custom field for ManyToMany

2006-10-12 Thread Ceph
I seem to recall some documentation somewhere, but it appears I was hallucinating because I can't find it again. Is there a way to add custom field in a Django ManyToMany relationship? Example has two models, Article and Category. An Article has a ManyToMany relationship to Categories. However,

Choosing a format for built-in comments

2006-10-12 Thread Tool69
Hi, I've made a little blog app, but i'm not satisfied with django's free-comment. In fact, I would like the user to choose an entry format, (like in my AdminPanel) : (X)HTML, ReST, Markdown or TexTile. How can I simply implement this? I'm actually a Django newbie, so don't blame me if the answer

mod_python multiuser DB access issue

2006-10-12 Thread AlexK
Hi all, I have config: Django 0.91, apache 2.0.55, mod_python 2.3.8, Win XP. When I test my app by page requests from different browsers at the same time (concurrent access testing), I receive errors like these: = -- when 2 clients attempt to get page: Mo

Django on Sitepoint

2006-10-12 Thread Enrico
Hi all, Seems that Django keeps spreading, there's an article on Sitepoint: http://www.sitepoint.com/article/build-to-do-list-30-minutes Very nice. Best regards. Enrico --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Caching with cache middleware disabled?

2006-10-12 Thread [EMAIL PROTECTED]
Hi everyone, I'm experiencing some problems on an application I did. Basically, it's just a tiny blog application, deployed on an Apache+mod_python server. The problem is that whenever I add a new post, it doesn't show in the front page even though it shows in the RSS feed. Both the frontpage an

Re: Extending a template - error

2006-10-12 Thread MerMer
my settings look like the following:- TEMPLATE_DIRS = ( "c:/python24/lib/site-packages/django/bin/mysite/mytemplates", When I set up Django I just put in the full path in the belief that this would make things easier while I was testing stuff. MerMer --~--~-~--~~~-

Re: Rich Text Fields in Admin

2006-10-12 Thread Ramdas S
Hi,   What perrygeo and schotm has suggested works perfectly.   I am happy to resolve it. I shall try adding a line or two to the wiki post on the topic, with couple of variants from my side.   Thanks a lot guys! You all are great   Ramdas  On 10/12/06, Ramdas S <[EMAIL PROTECTED]> wrote: What per

Re: When to

2006-10-12 Thread Frankie Robertson
On 12/10/06, MerMer <[EMAIL PROTECTED]> wrote: > > As a follow on. Can I:- > > Combine all three templates by using inheritance between the templates. > > Unfortunately, I haven't been able to test this yet - because I can't > get the "extend tag" to work (see other post).I am assuming that i

Re: Is persistence required for associations?

2006-10-12 Thread Sam Newman
On 10/12/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > [...] > > In other persistence layers - Hibernate comes to mind - if I directly > > create the association as I have done here, I can query that > > association before persistence. > > It's not a common use-case, though, since if you ar

Re: Extending a template - error

2006-10-12 Thread Malcolm Tredinnick
On Thu, 2006-10-12 at 05:36 -0700, MerMer wrote: > I am trying to extend a template. My parent Template is in > mysite/mytemplates/promotions/ > and the child template is in mysite/mytemplates/polls/ > > I get the following error saying that the template cannot be found when > I try:- > > {% ex

Re: When to

2006-10-12 Thread MerMer
As a follow on. Can I:- Combine all three templates by using inheritance between the templates. Unfortunately, I haven't been able to test this yet - because I can't get the "extend tag" to work (see other post).I am assuming that it won't work because of the following. Could someone confir

Re: Is persistence required for associations?

2006-10-12 Thread Malcolm Tredinnick
On Thu, 2006-10-12 at 13:06 +0100, Sam Newman wrote: > I'm trying to write a simple unit test for one of my models. I have > two models - Build and Project. A Project has multiple Builds. I want > to be able to create a build object, with an association to a Project. > However I seem unable to do

Re: Flup error log

2006-10-12 Thread orestis
Here is the responsible handler in Rails: http://dev.rubyonrails.org/browser/trunk/railties/lib/fcgi_handler.rb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send emai

Re: Extending a template - error

2006-10-12 Thread Julio Nobrega
I think templates to be inherited must be on the base template dir... I remember reading this somewhere but can't find references online. Can you test please? On 10/12/06, MerMer <[EMAIL PROTECTED]> wrote: > > I've now moved the parent template into the same directory as the child > template b

Re: Extending a template - error

2006-10-12 Thread MerMer
I've now moved the parent template into the same directory as the child template but I'm still getting the same error. Exception Value:Template 'results.html' cannot be extended, because it doesn't exist Exception Location: C:\Python24\lib\site-packages\django_src\django\template\

Flup error log

2006-10-12 Thread orestis
I've been browsing the rails mailing lists for a while, they seem to have a fastcgi.crash.log that gets all the fastcgi problems, instead of passing them to the apache error.log Is there any way to do this with flup ? --~--~-~--~~~---~--~~ You received this messa

Extending a template - error

2006-10-12 Thread MerMer
I am trying to extend a template. My parent Template is in mysite/mytemplates/promotions/ and the child template is in mysite/mytemplates/polls/ I get the following error saying that the template cannot be found when I try:- {% extends "mytemplates/promotions/promotion_list.htm" %} The error r

Is persistence required for associations?

2006-10-12 Thread Sam Newman
I'm trying to write a simple unit test for one of my models. I have two models - Build and Project. A Project has multiple Builds. I want to be able to create a build object, with an association to a Project. However I seem unable to do this unless I actually save the Project instance to the datab

When to

2006-10-12 Thread MerMer
Slowly trying to see the light... can anybody put me straight on the following:- I have three different templates. Each template gives a simple list of a model (table in the database).I now want to create a single template that displays all three lists. Can I:- a) Combine all three templa

Re: What IDE do you use? (semi-OT)

2006-10-12 Thread Pascal Bach
While working on larger Projects I use Eclipse (http://www.eclipse.org) with PyDev (http://pydev.sourceforge.net/) to edit the Python files, ans Subclipse to get Subversion out of Eclipse (http://subclipse.tigris.org/). There are althoug other useful plugins for different tasks. With Eclipse have

Re: Python on 64 -bit & multi-cores

2006-10-12 Thread Kenneth Gonsalves
On 12-Oct-06, at 4:06 PM, Santosh Koti wrote: > I am new to django/python world.!! new to mailing lists also? when starting a new topic please dont just press reply to an old mail as it confuses thread aware mail clients > > I am halfway in learning python , as of now seems quite easy :) > >

Re: more fun with custom fields

2006-10-12 Thread Bryan L. Fordham
>Not at the moment. There are two problems that need solving here (I've >mentioned this before either on this list or django-dev) and they're >both still on my endless TODO list. I'll get to them one day. > > I bet your todo list looks like mine 8) >(1) For fields that are Python wrappers over

Python on 64 -bit & multi-cores

2006-10-12 Thread Santosh Koti
Hi all, I am new to django/python world.!! I am halfway in learning python , as of now seems quite easy :) Well I got some questions to ask: What is the stand of Django/Python on 64 -bit & multi core processors ...? Support of Ajax/flex in django/python..! PS: I will forward this to py

Re: limit choices of records of a ForeignKey field

2006-10-12 Thread Benedict Verheyen
Benedict Verheyen schreef: I found a solution in the "limited_choices_to" argument of the ForeignKey function. I get the results i want by specifiying this: patient = models.ForeignKey(Patient, null=False, limit_choices_to = {'actief':True}) instead of patient = models.ForeignKey(Patient, null=

FastCGI on Dreamhost: Multiple processes ?

2006-10-12 Thread orestis
Hello, I was having periodical troubles with the FastCGI approach on DreamHost. I was following the documentation regarding FastCGI on a shared host. I contacted support and they replied with this: Oct 11 16:49:01 smithers Procwatch: killed naughty pid 10811 - orestis with /usr/bin/python2.4 djan

Re: Displaying number of visitors

2006-10-12 Thread orestis
Thanks! I'll try that! --~--~-~--~~~---~--~~ 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, send email to [EMAIL PR

Re: Display related foreign key values in Admin - but not inline

2006-10-12 Thread orestis
Thanks! I'll try that and get back here... --~--~-~--~~~---~--~~ 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, sen

Re: Rich Text Fields in Admin

2006-10-12 Thread schotm
Hi Randas, I've been using the tutorial on: http://www.socialistsoftware.com/post/django-and-tinymce/ The tutorial is a bit outdated so look at the following things: Make sure you copy the tiny_mce folder into /usr/local/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/contrib/admin/med

Re: Where do newbies go to ask questions?

2006-10-12 Thread Kenneth Gonsalves
On 12-Oct-06, at 12:19 PM, Andy Skogrand wrote: > I have a fairly simple question to ask, and I dont know where to ask > it. come to #django on freenode -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ You rec

Re: Display related foreign key values in Admin - but not inline

2006-10-12 Thread patrickk
if I´m not mistaken, what malcolm described is not too hard to achieve. ### copy the change_form.html to you personal admin-directory ### change the change_form: add something like {% ShowGreekWords object_id %} ### GreekWords is a templatetag which might look like: from django.template import

limit choices of records of a ForeignKey field

2006-10-12 Thread Benedict Verheyen
Hi, i have a model "Patient" that has a field active. Active = True by default. If the users want to delete a patient, they actually want to first deactivate the patient meaning setting the active field to False. All lists and records that link to this patient model should only display patients

Re: Where do newbies go to ask questions?

2006-10-12 Thread Andy Skogrand
> 3a) (if you are using the development webserver) Does the server > indicate that it has identified the model change and reloaded? > Alternatively, have you restarted the webserver since making the > change to the model? I was running around not understanding what had gone wrong, and I stumbled

Re: Where do newbies go to ask questions?

2006-10-12 Thread Russell Keith-Magee
On 10/12/06, Andy Skogrand <[EMAIL PROTECTED]> wrote: > > I have a fairly simple question to ask, and I dont know where to ask > it. This mailing list is one of the places worth trying. Timezone permitting, the IRC channel can also be a useful resource for newcomers. > Essentially my issue is th

Re: Rich Text Fields in Admin

2006-10-12 Thread Malcolm Tredinnick
On Thu, 2006-10-12 at 10:39 +0530, Ramdas S wrote: > Malcom, > > The display is fine. The web site is working perfectly. I am able to > populate the database. > > But I am not able to get the rich text box in any of the text areas in > the particular model or for the table in question. > > I h

Where do newbies go to ask questions?

2006-10-12 Thread Andy Skogrand
I have a fairly simple question to ask, and I dont know where to ask it. Essentially my issue is that I went through the Django Tutorial: http://www.djangoproject.com/documentation/tutorial2/ and I created the polls app and then stated inside it models.py that it could be editable by the admin p