Re: Fixed column width in admin interface?

2015-11-14 Thread Gergely Polonkai
Or you can apply a CSS with overflow: ellipsis; whichever fits you. On 14 Nov 2015 17:10, "Simon Charette" wrote: > Hi Jorgue, > > You can simply define a `list_display` method > > that truncat

Re: Django tutorial part 4...omission?

2015-11-14 Thread James Schneider
> > I am wondering if Part 4 of the "Writing you first Django App" tutorial is > missing a section about using the .as_view() function in the relevant > urls.py file when implementing class based views? The tutorial discussed > how to write a class base view, but never instructs about how to make t

Django tutorial part 4...omission?

2015-11-14 Thread roahn . wynar
I am wondering if Part 4 of the "Writing you first Django App" tutorial is missing a section about using the .as_view() function in the relevant urls.py file when implementing class based views? The tutorial discussed how to write a class base view, but never instructs about how to make the cor

Re: How can you use the @cache_page decorator with Django class based views?

2015-11-14 Thread Simon Charette
Hi Daniels, There's a tentative API being worked on Github. You might want to have a look at it . Simon Le samedi 14 novembre 2015 13:38:18 UTC-5, daniels a écrit : > > The only method that seems to be working is adding the decorator in > urls.py whi

How can you use the @cache_page decorator with Django class based views?

2015-11-14 Thread daniels
The only method that seems to be working is adding the decorator in urls.py which is ugly. Is there any way to apply this decorator in the view? class HomeView(View): @method_decorator(cache_page(60 * 60)) def dispatch(self, *args, **kwargs): return super(HomeView, self).dispat

Re: Fixed column width in admin interface?

2015-11-14 Thread Simon Charette
Hi Jorgue, You can simply define a `list_display` method that truncates your text if required and append an ellipsis. e.g. class FooAdmin(admin.ModelAdmin): list_display = ['text_field_

Re: Model Meta option default_related_name not setting related_query_name

2015-11-14 Thread Simon Charette
Hi Alejandro, This looks like a bug and overlook to me but as Tim pointed out simply changing it would be backward incompatible at this point. If we were to fix this issue we would need to deprecate the actual behavior first. The deprecation path would involve raising a warning when the actual

Fixed column width in admin interface?

2015-11-14 Thread Jorge Fernandez-de-Cossio-Diaz
A column of my Django admin interface sometimes has too much text. When this happens, I would like to replace the last part of the text with "...", so that the column width doesn't gets past a maximum character count. How can I do this? -- You received this message because you are subscribed t

Re: Usage of select_related() on a OneToOneField with parent_link=True doesn't work

2015-11-14 Thread Simon Charette
Hi Gilad, The `parent_link` option can only be used if the model the o2o field is pointing to is a direct base of the model it's attached to. From what I understand `select_related` simply ignores `parent_link` fields since it assumes it's pointing to a MTI parent table which are JOINed by defa

Re: Model Meta option default_related_name not setting related_query_name

2015-11-14 Thread Tim Graham
I guess it would be backwards incompatible if we changed the behavior now, wouldn't it? On Friday, November 13, 2015 at 1:40:27 PM UTC-5, Alejandro Do Nascimento wrote: > > django...@googlegroups.com > > Hello, > > I have a doubt, In a model I'm using the Meta option * > default_related_name*

Re: Bug: Manually changing "_meta.db_table" for model causes "missing FROM-clause entry for table" error

2015-11-14 Thread Tim Graham
I'm not sure that type of monkeypatching of Model._meta.db_table is meant to be supported. You could try to bisect Django's commit history to find the commit that changed the behavior. My guess it that it might have to do with some internal caching such that your monkeypatch no longer has any e

Usage of select_related() on a OneToOneField with parent_link=True doesn't work

2015-11-14 Thread Gilad
Hi, Using Django 1.8.3, I have 2 models, both unmanaged (remote DB managed by another system), with something similar to that: class Parent(Model): ... some fields... class Child(Model): id = OneToOneField(primary_key=True, parent_link=True) ... some other fields ... Notes: 1. Parent is not

Re: Time out when requesting element from Admin

2015-11-14 Thread Joseph Wenninger
I don't know about the rest part, but for admin I'd try to use raw_id_fields, that doesn't fetch the whole Unicode/str representation for all elements the foreign key could point to. Do you have some complex code in __unicode__ or __str__? Raw Id documentation: ModelAdmin.raw_id_fields¶ By defa