Message from discussion
docstrings for inherited models not showing in Admin Docs
Received: by 10.66.81.200 with SMTP id c8mr6223488pay.1.1352599048599;
Sat, 10 Nov 2012 17:57:28 -0800 (PST)
X-BeenThere: django-users@googlegroups.com
Received: by 10.68.236.33 with SMTP id ur1ls20542465pbc.2.gmail; Sat, 10 Nov
2012 17:56:36 -0800 (PST)
Received: by 10.66.85.168 with SMTP id i8mr6228503paz.21.1352598996959;
Sat, 10 Nov 2012 17:56:36 -0800 (PST)
Received: by 10.66.85.168 with SMTP id i8mr6228502paz.21.1352598996949;
Sat, 10 Nov 2012 17:56:36 -0800 (PST)
Return-Path: <mi...@dewhirst.com.au>
Received: from mail.turbonet.com.au (mail.turbonet.com.au. [203.17.237.132])
by gmr-mx.google.com with ESMTP id js4si572317pbb.2.2012.11.10.17.56.35;
Sat, 10 Nov 2012 17:56:36 -0800 (PST)
Received-SPF: neutral (google.com: 203.17.237.132 is neither permitted nor denied by best guess record for domain of mi...@dewhirst.com.au) client-ip=203.17.237.132;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 203.17.237.132 is neither permitted nor denied by best guess record for domain of mi...@dewhirst.com.au) smtp.mail=mi...@dewhirst.com.au
Received: from localhost (localhost.localdomain [127.0.0.1])
by mail.turbonet.com.au (Postfix) with ESMTP id 6D60F224196
for <django-users@googlegroups.com>; Sun, 11 Nov 2012 12:56:33 +1100 (EST)
X-Virus-Scanned: amavisd-new at legion.com.au
X-Spam-Flag: NO
X-Spam-Score: 0.161
X-Spam-Level:
X-Spam-Status: No, score=0.161 tagged_above=-999 required=5
tests=[ALL_TRUSTED=-1, AWL=-0.580, BAYES_50=0.8, RDNS_NONE=0.941]
autolearn=no
Received: from mail.turbonet.com.au ([203.17.237.132])
by localhost (santa.legion.com.au [127.0.0.1]) (amavisd-new, port 10030)
with LMTP id qVI+S3uQRdx6 for <django-users@googlegroups.com>;
Sun, 11 Nov 2012 12:56:28 +1100 (EST)
Received: from [192.168.0.50] (unknown [203.25.139.148])
by mail.turbonet.com.au (Postfix) with ESMTP id C783A224072
for <django-users@googlegroups.com>; Sun, 11 Nov 2012 12:56:28 +1100 (EST)
Message-ID: <509F0599.9040302@dewhirst.com.au>
Date: Sun, 11 Nov 2012 12:55:37 +1100
From: Mike Dewhirst <mi...@dewhirst.com.au>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121026 Thunderbird/16.0.2
MIME-Version: 1.0
To: django-users@googlegroups.com
Subject: Re: docstrings for inherited models not showing in Admin Docs
References: <c8b7f896-0bdf-4919-84cf-be4cd02b53c1@googlegroups.com>
In-Reply-To: <c8b7f896-0bdf-4919-84cf-be4cd02b53c1@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
David
I think the solution is to look at the admindocs source and tweak it to
do what you want and submit a patch.
The target audience for admindocs is template authors. This means you
are possibly trying to make admindocs do something it wasn't designed to
do. I don't mean your specific problem because I think template authors
do need to see the inheriting model docstring. Rather, it is possible
you want admindocs for developer documentation.
I discovered this recently when a patch I submitted was rejected on
those grounds. I wanted to see model methods with args documented but
that takes admindocs away from its objectives. Template authors can't
use arguments when using model methods.
Mike
On 11/11/2012 1:15am, David Simmons wrote:
> Hi
>
> I'm using Django 1.4.2. I have a base model:
>
> class Account(models.Model):
> account_id = models.CharField(max_length=10, unique=True)
> name = models.CharField(max_length=50)
> balance = models.DecimalField(max_digits=20, decimal_places=2)
>
>
> and I have child model that inherits from the base model:
>
>
> class BankAccount(Account):
> """
> Stores an instance of a Bank Account.
>
> """
>
> bank_name = models.CharField(max_length=50)
> sort_code = models.CharField(max_length=8)
>
>
> The details of the BankAccount show up in the Admin Docs but the doc string describing the BankAccount does not. Am I doing something wrong?
>
>
> many thanks for your help
>
>
> Dave
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/28407o7fHOoJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.