Templates and Views - what counts as "logic"?

2006-10-28 Thread ringemup
Hi all, I'm creating a blog as a first Django project, since that seems like a good way to get my feet wet. I've run into a problem displaying a list of post excerpts with "read more" links. Here's my code for the excerpts: {% for object in object_list %} {{ object.title }}

Prepopulate Form

2006-10-28 Thread shidan
Hi, I want the same functionality as the ChangeManipulator where it prepopulates the form with the current values of the object, how can I do this with custom form manipulator. Shidan --~--~-~--~~~---~--~~ You received this message because you are subs

Re: media files with django dev-server

2006-10-28 Thread patrickk
Am 26.10.2006 um 16:21 schrieb orestis: > >>> (1) to use the dev server >>> (2) no changes when moving to production >>> (3) to have core and non-core content served out of the >>> ADMIN_MEDIA_PREFIX prefix. >> >> 1 and 2 is true (especially 2). >> 3 not ... I don´t care serving admin_media with

Re: How to find all objects in a model that don't have a many2one relationship defined?

2006-10-28 Thread Andrew
Sorry, that was a mistype in the original post. Should read: Post.objects.exclude(rating__user = user) mostly works, but it *also* excludes all Posts that have not been rated by *any* users yet (don't have rows in the Rating table). So I need a way to word the exclusion in a way that works, or

Re: How to find all objects in a model that don't have a many2one relationship defined?

2006-10-28 Thread [EMAIL PROTECTED]
Andrew, Have you tried exlude? http://www.djangoproject.com/documentation/db_api/#exclude-kwargs Post.objects.exclude(rating__user = user) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: ManyToMany "Cannot resolve keyword"

2006-10-28 Thread NakedHTML
Thanks to everyone for your help and support! As it turns our, Malcoms advice of: >Then start removing code from your models until things start working again. ...was what I needed. It gave me a chance to wade through the models and find the offending code. Looks like it was line 84 of the ori

Re: Django apache_auth with postgresql

2006-10-28 Thread Michael Best
I discovered the Mysql part was a red herring and was just because I had mod_auth_mysql installedIt seems to be an environment variable issue.  I've tried both suggested method, but neither seems to work.    SetEnv DJANGO_SETTINGS_MODULE exampleuser.settings    PythonOption DJANGO_SETTINGS_MODULE

How to find all objects in a model that don't have a many2one relationship defined?

2006-10-28 Thread Andrew
I've had this working in raw SQL, but I'm refactoring and trying to django-ify things a little bit. I thought it would be simple, but I'm stuck. I have a Post model and a Rating model. The Rating model has a one-to-many relationship with Post, a one-to-many relationship with User, and a score. (

Re: ManyToMany "Cannot resolve keyword"

2006-10-28 Thread samulih
Jay Parlar wrote: > On 10/28/06, NakedHTML <[EMAIL PROTECTED]> wrote: > > > > Okay, I trimmed things down a bit and put the models into a new > > project. Models -> http://paste.e-scribe.com/2425/ > > > > I'm trying to access the reporter (or reporters) of the story in the > > template using -> ht

Re: Can't get Apache + mod_python + sqlite3 to work

2006-10-28 Thread Bryan Murdock
One thing I noticed when I set up sqlite was that the apache user had to have full permissions on both the database file and the directory where the file was contained. I don't remember the exact errors I got back when I had that problem, but figured I'd throw out my experience. Bryan On 10/26/

Re: ManyToMany "Cannot resolve keyword"

2006-10-28 Thread Jay Parlar
On 10/28/06, NakedHTML <[EMAIL PROTECTED]> wrote: > > Okay, I trimmed things down a bit and put the models into a new > project. Models -> http://paste.e-scribe.com/2425/ > > I'm trying to access the reporter (or reporters) of the story in the > template using -> http://paste.e-scribe.com/2424/ >

Re: ManyToMany "Cannot resolve keyword"

2006-10-28 Thread NakedHTML
Okay, I trimmed things down a bit and put the models into a new project. Models -> http://paste.e-scribe.com/2425/ I'm trying to access the reporter (or reporters) of the story in the template using -> http://paste.e-scribe.com/2424/ Same as before, this randomly works and errors out with -> htt

Custom manipulator

2006-10-28 Thread [EMAIL PROTECTED]
Hi all, I've got problems (mainly due to my misunderstanding of Django manipulators) making a custom manipulator work. The code http://paste.e-scribe.com/2421/ works but has two quirks: 1) {{form.teacher}} doesn't render the actual teacher assigned to that course but just the first in the list

Django apache_auth with postgresql

2006-10-28 Thread Michael Best
I don't know if you can help with this. I'm having a little trouble with using the Django auth method in Apache, the error log indicates that it is trying a non-existant mysql database (when I am using postgresql) perhaps I have a setting wrong, wrong file, or something missing? The exampleuser/

comment contrib

2006-10-28 Thread Grigory Fateyev
Hello! I want to use comment contrib for my apps, but have some problem: My template article_detail.html is: [...] {% get_comment_list for articles.Article object.id as comment_list %} {% trans 'Comments' %} {% for comment in comment_list %} {{ comment.comment }} {% endfor %} {% tran

Re: How to get a models.Manager to stay sync'd with the database?

2006-10-28 Thread doubtintom
Thanks Malcom, very enlightening. I would be very interested in learning how/where to go about reconstructing the queryset. Tom Here is the relevant section of my model: class TaskManager(models.Manager): def get_query_set(self):