Re: Model verbose name appears to split up on capitalisation (e.g. "iOS") - any way to suppress this?

2013-08-15 Thread Mike Dewhirst

On 15/08/2013 4:57pm, Victor Hooi wrote:

Hi,

That works =):



I just found the same thing mentioned on SO as well:

http://stackoverflow.com/a/9111694

Hmm, I'm guessing this is a known gotcha and workaround, right? Is it
documented anywhere in the Django docs, or is it considered too much of
an edge case?


Personally, I think it is a Django bug. There are two cases. One is that 
Django figures out what to display from the model class name (or field 
name) all by itself. The other is that I decide what to display via 
verbose_name and additionally for model classes, verbose_name_plural.


I think it should not be getting title case.

I did some digging in Django source and found it won't be easy for 
someone like me to fix it. Hence the workaround.


Mike






Cheers,
Victor

On Thursday, 15 August 2013 15:08:00 UTC+10, Mike Dewhirst wrote:

On 15/08/2013 2:06pm, Victor Hooi wrote:
 > For example, verbose_name-Plural on the main admin page (/admin)
still
 > seems to insist on capitalising the first "i" - as in, it appears as
 > "IOS clients", rather than "iOS clients", as it's set in class Meta:
 >

Try verbose_name = " iOS Clients" with a leading space

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Model verbose name appears to split up on capitalisation (e.g. "iOS") - any way to suppress this?

2013-08-15 Thread Victor Hooi
Hi,

That works =):


I just found the same thing mentioned on SO as well:

http://stackoverflow.com/a/9111694

Hmm, I'm guessing this is a known gotcha and workaround, right? Is it 
documented anywhere in the Django docs, or is it considered too much of an 
edge case?

Cheers,
Victor

On Thursday, 15 August 2013 15:08:00 UTC+10, Mike Dewhirst wrote:
>
> On 15/08/2013 2:06pm, Victor Hooi wrote: 
> > For example, verbose_name-Plural on the main admin page (/admin) still 
> > seems to insist on capitalising the first "i" - as in, it appears as 
> > "IOS clients", rather than "iOS clients", as it's set in class Meta: 
> > 
>
> Try verbose_name = " iOS Clients" with a leading space 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Model verbose name appears to split up on capitalisation (e.g. "iOS") - any way to suppress this?

2013-08-14 Thread Mike Dewhirst

On 15/08/2013 2:06pm, Victor Hooi wrote:

For example, verbose_name-Plural on the main admin page (/admin) still
seems to insist on capitalising the first "i" - as in, it appears as
"IOS clients", rather than "iOS clients", as it's set in class Meta:



Try verbose_name = " iOS Clients" with a leading space

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Model verbose name appears to split up on capitalisation (e.g. "iOS") - any way to suppress this?

2013-08-14 Thread Victor Hooi
Hi,

Aha, that's embarrassing...yes, it was the lowercase M.

The extra spacing appears to be fixed now.

However, capitalisation still seems a bit funny.

For example, verbose_name-Plural on the main admin page (/admin) still 
seems to insist on capitalising the first "i" - as in, it appears as "IOS 
clients", rather than "iOS clients", as it's set in class Meta:


However, strangely enough the verbose_name is capitalised correctly:


Is there any way to fix that issue?

And DRF is just being completely random, but I guess I'll ned to look into 
that to see where it's getting it's verbose form from:



Cheers,
Victor

On Thursday, 15 August 2013 12:50:40 UTC+10, Ramiro Morales wrote:
>
> On Wed, Aug 14, 2013 at 11:46 PM, Victor Hooi 
>  
> wrote: 
> > Hi, 
> > 
> > I have a Django model: 
> > 
> >> class iOSClient(models.Model): 
> >> ... 
> >> class meta: 
> >> ... 
> >> verbose_name = 'iOS client' 
> >> verbose_name_plural = 'iOS clients' 
> > 
> > 
> > However, when this model appears in the Django Admin, or in say, Django 
> Rest 
> > Framework, the human-readable name seems to given as "I os client" or "i 
> os 
> > client". 
> > 
> > Is there any way to easily suppress this behaviour? 
>
> These textual representations should be obeying what you specified with 
> the verbose_name* options. 
>
> Are you actually using "meta"? It should be Meta with a capital M. 
>
> Can you try that and tell us if that solves things for you? 
>
> -- 
> Ramiro Morales 
> @ramiromorales 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Model verbose name appears to split up on capitalisation (e.g. "iOS") - any way to suppress this?

2013-08-14 Thread Ramiro Morales
On Wed, Aug 14, 2013 at 11:46 PM, Victor Hooi  wrote:
> Hi,
>
> I have a Django model:
>
>> class iOSClient(models.Model):
>> ...
>> class meta:
>> ...
>> verbose_name = 'iOS client'
>> verbose_name_plural = 'iOS clients'
>
>
> However, when this model appears in the Django Admin, or in say, Django Rest
> Framework, the human-readable name seems to given as "I os client" or "i os
> client".
>
> Is there any way to easily suppress this behaviour?

These textual representations should be obeying what you specified with
the verbose_name* options.

Are you actually using "meta"? It should be Meta with a capital M.

Can you try that and tell us if that solves things for you?

-- 
Ramiro Morales
@ramiromorales

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.