Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How does admin generate HTML for adding objects?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Technicalbard  
View profile  
 More options Jul 2, 6:02 pm
From: Technicalbard <rodwe...@gmail.com>
Date: Thu, 2 Jul 2009 15:02:44 -0700 (PDT)
Local: Thurs, Jul 2 2009 6:02 pm
Subject: How does admin generate HTML for adding objects?
I'm curious how the admin creates the templates for any object in the
database...

I'm using the object_detail generic view, but would prefer having
Django use the parameters of the object to generate the template,
rather than me having to hardcode the parameter names into the
template.

The admin does this when you create new objects - how?  The docs don't
seem to lead me to this.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TechnicalBard  
View profile  
 More options Jul 3, 1:06 am
From: TechnicalBard <rodwe...@gmail.com>
Date: Thu, 2 Jul 2009 22:06:02 -0700 (PDT)
Local: Fri, Jul 3 2009 1:06 am
Subject: Re: How does admin generate HTML for adding objects?
To clarify, the djangobook states:

<< On the admin site’s edit forms, each field’s label is generated
from its model field name. The algorithm is simple: Django just
replaces underscores with spaces and capitalizes the first character,
so, for example, the Book model’s publication_date field has the label
“Publication date.” >>

Where in the django.contrib.admin code is this logic found?  I would
like to utilize it.

On Jul 2, 4:02 pm, Technicalbard <rodwe...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Buchanan  
View profile  
 More options Jul 3, 3:16 am
From: Jonathan Buchanan <jonathan.bucha...@gmail.com>
Date: Fri, 3 Jul 2009 08:16:08 +0100
Local: Fri, Jul 3 2009 3:16 am
Subject: Re: How does admin generate HTML for adding objects?

On Fri, Jul 3, 2009 at 6:06 AM, TechnicalBard<rodwe...@gmail.com> wrote:

> To clarify, the djangobook states:

> << On the admin site’s edit forms, each field’s label is generated
> from its model field name. The algorithm is simple: Django just
> replaces underscores with spaces and capitalizes the first character,
> so, for example, the Book model’s publication_date field has the label
> “Publication date.” >>

> Where in the django.contrib.admin code is this logic found?  I would
> like to utilize it.

This is part of the forms library - django.forms.forms.pretty_name [1]
is used [2] to generate a label from the field name if a label was not
given when the field was instantiated.

Jonathan.

[1] http://code.djangoproject.com/browser/django/trunk/django/forms/forms...
[2] http://code.djangoproject.com/browser/django/trunk/django/forms/forms...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chhouk Voeun  
View profile  
 More options Jul 3, 3:21 am
From: Chhouk Voeun <voeun.chh...@gmail.com>
Date: Fri, 3 Jul 2009 14:21:40 +0700
Local: Fri, Jul 3 2009 3:21 am
Subject: Re: How does admin generate HTML for adding objects?

I want to stop join group


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TechnicalBard  
View profile  
 More options Jul 3, 12:21 pm
From: TechnicalBard <rodwe...@gmail.com>
Date: Fri, 3 Jul 2009 09:21:49 -0700 (PDT)
Local: Fri, Jul 3 2009 12:21 pm
Subject: Re: How does admin generate HTML for adding objects?
Thanks!

Related question:  when displaying a ModelForm, how does Django
iterate/enumerate how many fields the model has?

On Jul 3, 1:16 am, Jonathan Buchanan <jonathan.bucha...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google