Re: Admin inline for inherited model cant find pointer to parent model

2012-02-13 Thread Demetrio Girardi
he one-to-one relationship between parent and child is called 'parendmodel__ptr__id', and the admin is looking for 'childmodel_set-0-parentmodel_ptr' in the formset data. Why? On Mon, Feb 13, 2012 at 10:43 AM, Demetrio Girardi <demetrio.gira...@gmail.com> wrote: > I have a child model that I w

Admin inline for inherited model cant find pointer to parent model

2012-02-13 Thread Demetrio Girardi
I have a child model that I wish edit inline in the admin site. When trying to save edits I get a MultiValueDictKeyError: "Key 'childmodel_set-0-parentmodel_ptr' not found in " It seems to me the admin is trying to get the reference to the parent model from the form data. How can I fix this? Do

Re: Generating a list of available templates

2012-02-10 Thread Demetrio Girardi
On 10 Feb 2012 at 14:50, Patrick Wellever wrote: > I want to make it a choice field that justs lists all the files in, for > example, > 'templates/flatpages/page_templates/', so the user can see what templates are > available and just > choose one from a select list. you can read the

WSGIHandler freezes, how do I find out why?

2012-02-09 Thread Demetrio Girardi
I have a single django project, deployed on two separate installations of Apache + python + mod_wsgi. The first installation has python 2.6 and everything works fine. The second installation has python 2.7. With this one, a few things work correctly - namely django's debug 404 pages, the login

ManyRelatedManager reference

2012-02-01 Thread Demetrio Girardi
I can't find a reference for ManyRelatedManager in the django docs. I have a few questions that you can ignore if there is in fact a reference somewhere and you can point me to it. If my model is class Model(models.Model): many = models.ManyToManyField(OtherModel) what does this do?

Determine gender from first name

2012-01-25 Thread Demetrio Girardi
This is not a django-specific question, but I couldn't find anything useful on the subject and have no better place to ask. Let's say I want to put "welcome {{user.first_name}}" on top of my template. In many languages, "welcome" has to be declined by gender. I have no use for the user's gender

Primary key for read-only models

2012-01-12 Thread Demetrio Girardi
I need to read data from an "external" database table from my django project. I am not interested in modifying the data, only reading it. Of course I would like to create a django model for the table, because it makes life so much more easier. I have already done this previously, however in this

project root or its parent in pythonpath?

2012-01-05 Thread Demetrio Girardi
Upon reading the django tutorial, I was under the impression that you should have the project root folder in your pythonpath, so that each app is available for import in modules, e.g. you can do import myapp However, my IDE seems to prefer putting its root in the pythonpath, so you'd have to

Re: Advice/tips on how make private directory for each user?

2011-12-25 Thread Demetrio Girardi
Static files are not handled by django, so you would have to configure your webserver for authentication and access control. You can however create a django view that picks stuff from the filesystem and serves it as attachment:

Translating templates

2011-12-14 Thread Demetrio Girardi
My project has a bunch of text embedded deep within the html markup in templates that I need to translate. The text, imo, belongs to templates and it has no place in the application logic. >From what I understand, localization in templates is limited to variables, which is not useful to me.