Re: Alternative to listdir on every page view

2008-03-08 Thread Prof. William Battersea
> > > On Fri, 2008-03-07 at 08:16 -0500, Prof. William Battersea wrote: > > Hello, > > > > I'm working on a photo gallery for a user. I wanted to make it dead > > easy for him to create the gallery and upload photos. Right now, each > > t

Alternative to listdir on every page view

2008-03-07 Thread Prof. William Battersea
Hello, I'm working on a photo gallery for a user. I wanted to make it dead easy for him to create the gallery and upload photos. Right now, each time a gallery page is viewed, I look at the directory where the thumbnails are stored using listdir and slice the resulting list depending on what page

Re: [error] 'str' object has no attribute 'creation_counter'

2008-02-10 Thread Prof. William Battersea
Thank you, that's very clear now. I completely forgot those were querysets. Thank you for your time. WB On Feb 10, 2008 10:48 AM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > On Sun, 2008-02-10 at 10:33 -0500, Prof. William Battersea wrote: > [...] > > >

Re: [error] 'str' object has no attribute 'creation_counter'

2008-02-10 Thread Prof. William Battersea
On Feb 10, 2008 9:50 AM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > On Sun, 2008-02-10 at 09:27 -0500, Prof. William Battersea wrote: > > Hello, > > > > I created a Django application, validated it for errors and ran syncdb > > without any problems.

[error] 'str' object has no attribute 'creation_counter'

2008-02-10 Thread Prof. William Battersea
Hello, I created a Django application, validated it for errors and ran syncdb without any problems. I can click into the admin section but as soon as I click "Add" for one of my models I get the error AttributeError at /admin/gallery/gallery/add/ 'str' object has no attribute 'creation_counter' R

Re: Where to store static files?

2008-01-14 Thread Prof. William Battersea
Ah, okay. Got it. Thanks. 2008/1/14 Alex Koshelev <[EMAIL PROTECTED]>: > > The best solution is to separate admin media files and site specific > files. For example: > /media/admin/ - for admin static files > /media/ - for others > > On 14 янв, 20:14, "Prof. Willia

Where to store static files?

2008-01-14 Thread Prof. William Battersea
Hello, Does any one have any suggestions for setting up apache so that: 1. Admin files stay in the contrib/admin folder 2. Other static media stay in some other folder, with the rest of my site files. 3. I can use mysite.com/media for both of them. Longer explanation: I'm using Django on a sha

Re: An easier way to do this Pagination in a template?

2008-01-10 Thread Prof. William Battersea
Ahh. I eventually did write an inclusion tag. I see I could have saved myself some time, but it was nice to learn how to do it. Thanks! On Jan 10, 2008 9:53 AM, Paul Childs <[EMAIL PROTECTED]> wrote: > > Take a look here too... > > http://code.djangoproject.com/wiki/PaginatorTag > > > --~--~---

Re: An easier way to do this Pagination in a template?

2008-01-09 Thread Prof. William Battersea
; view and radically simplifies the template logic. It is easy to create > a filter that takes an argument, so the fact that you have two > inputs (page_number and current_page) is no problem. > > On Jan 9, 11:02am, "Prof. William Battersea" > <[EMAIL PROTECTED]> wr

An easier way to do this Pagination in a template?

2008-01-09 Thread Prof. William Battersea
Hello, On nearly every page of the website I'm creating, I have a list of recent articles in the sidebar that works as a complete archive. You can sort them by newest/oldest, and page through the entire archive. The template code for the pagination looks like this {% for page_number in page_list

Variable available to All users (static class?)

2007-10-26 Thread William Battersea
Hi, I'm probably describing this poorly because I've never done this and I come from a PHP background, but... Is there anyway that I can have some variable available to all the user sessions without resorting to a database. E.g. I suppose I want a variable 'busy'. If any user initiates a piece