admin recipe: sort on "computed fields", and a question?

2010-06-01 Thread shaunc
names some existing field. Is there some other way to do this? Is this a good candidate for enhancement (should I move over to "developers" or open a ticket?)? Thanks! -- Shaunc -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: How to customize ModelChoiceField?

2010-05-30 Thread shaunc
I think I've solved this myself. I needed two fields for description: one for the description pk (in case it is pre-existing) and one for the text. I changed the widget for the description via RateForm.Meta.widgets to a HiddenInput widget, and added the text field to the form separately. In

How to customize ModelChoiceField?

2010-05-29 Thread shaunc
I have a table of Rates: class Rate( models.Model ): edition = ForeignKey( Edition ) description = ForeignKey( Foo ) rate = IntegerField( ) ... [ other fields not relevant here ] and a RateForm: class RateForm( forms.ModelForm ): class Meta: fields = ( 'description',

Re: InternalError -- django specific state?

2009-12-18 Thread shaunc
 am, shaunc <sh...@cuttshome.net> wrote: > Can anyone help me with the following point? > > Does django keep internal state when psycopg throws a > OperationalError, and how do I clear it? > > The situation is this: I have external processes writing into a django/ > postgr

InternalError -- django specific state?

2009-12-17 Thread shaunc
Can anyone help me with the following point? Does django keep internal state when psycopg throws a OperationalError, and how do I clear it? The situation is this: I have external processes writing into a django/ postgres database. To avoid using semaphors, etc, I'm trying to use a row level lock

Re: flatpage -- content type?

2008-09-13 Thread shaunc
umm... but that's not exactly according to "D.R.Y." :) -- but thanks. On Sep 13, 3:36 pm, "Matthias Kestenholz" <[EMAIL PROTECTED]> wrote: > On Sat, Sep 13, 2008 at 9:33 PM, shaunc <[EMAIL PROTECTED]> wrote: > > > Hello, > > > Does anyone kno

flatpage -- content type?

2008-09-13 Thread shaunc
Hello, Does anyone know how to set the content type when serving a page via FlatPages? Thanks, - Shaun --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

using make-messages in native non-english site

2007-11-20 Thread shaunc
Can I use make-messages to create english translation files for a site that is originally written in something other than english? I don't see how the "source" language is specified. Thanks, - Shaun --~--~-~--~~~---~--~~ You received this message because you are

newforms BoundField prefix treatment.

2007-11-12 Thread shaunc
Hello, I'm confused: why does BoundField.as_widget retrieve initial data with self.name (without prefix): >>>def as_widget(self, widget=None, attrs=None): ... >>>if not self.form.is_bound: >>>data = self.form.initial.get(self.name, self.field.initial) But if there is

clearing related manager cache

2007-03-27 Thread shaunc
In a many-to-one relationship (ie reverse of ForeignKey), an instance has a related manager that (apparently) caches its relatees, at least in some circumstances. Is it possible to clear this cache? This would be useful in the following scenario: class Foo( Model ): pass class Bar( Model

Re: How do I pass a value through a template?

2006-10-10 Thread shaunc
Ivan Sagalaev wrote: > carlwenrich wrote: > > Thanks. I like the hidden input type idea. > > In practice it's harder. > > > About sessions, do they > > still work if the user's browser doesn't accept cookies? > > They don't. But in current web cookies are pretty much a requirement for > sane

Re: static content -- authentication?

2006-09-19 Thread shaunc
Wonderful, James -- I had overlooked the existence of this. Small feature enhancement might be to mention it in doc in other places where static content is being talked about. - Shaun --~--~-~--~~~---~--~~ You received this message because you are subscribed to

static content -- authentication?

2006-09-18 Thread shaunc
I've read in several places about the advisability of serving static content via Apache (or whatever) rather than via django. Is it possible to somehow share an authentication context with Apache (via session coookie??)? We have a bunch of things like PDF reports, etc that can only be

close connections and restart django?

2006-05-29 Thread shaunc
Hello, I'm writing some scripts for a testing environment. I want to dump some core stuff from the database, recreate the database, and reload the stuff. I can do all the steps individually, but deleting the database requires closing the db connection. Can I get django to cleanup and close its