Re: Changing a model of place from the admin site

2010-08-17 Thread Mathieu Leduc-Hamel
Thanks Andy,

It might be a solution and maybe the only one as you said. I'll maybe try it
or somebody propose me this other solution:

Create a subclass of the models classes i would like to move by creating
proxy objects. It force you create sometime a large number of object but it
might less dangerous to break something...

On Tue, Aug 17, 2010 at 11:14 AM, AndyB  wrote:

> I did something similar by subclassing AdminSite and overriding the
> index method. Copy the original method from contrib.admin and modify
> app_list before you render the template.
>
> It does break breadcrumbs and intermediate app pages (/admin/someapp/)
> but with some shameless hackery I fixed this too:
>
>def app_index(self, request, app_label, extra_context=None):
>p = request.path.split('/')[-2].replace('_','-')
>if p=='cms':
>p='general-content'
>elif p=='auth':
>p='users'
>return HttpResponseRedirect('/admin/#'+p)
>
> (this basically redirects /admin/auth/ and /admin/cms/ to a named
> anchor on the index page instead)
>
> Andy
>
> On Aug 16, 4:41 pm, Mathieu Leduc-Hamel  wrote:
> > Hi all,
> >
> > I'm currently developing a e-commerce website using satchmo and
> > django. I would like to simplify the admin pannel from the user
> > perspective. This is why i would like to change the different group of
> > models. Right now, these group are organized by application. But when
> > using some external dependencies it some become a big mess to deal
> > with so many different group of options.
> >
> > Is it possible
> >
> > There is a example of what i would like to do. There you have a part
> > of my admin site hierarchy. I would like to move "Categories" and
> > "Discounts" from the "Product" group to the "Store" group.
> >
> > auth
> >   Groups
> >   Users
> > Contact
> >   Persons
> >   Organizations
> > Product
> >   Categories
> >   Discounts
> > Store
> >   Style
> >   Color
> >   Size
> >
> > How can it be done ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Changing a model of place from the admin site

2010-08-17 Thread AndyB
I did something similar by subclassing AdminSite and overriding the
index method. Copy the original method from contrib.admin and modify
app_list before you render the template.

It does break breadcrumbs and intermediate app pages (/admin/someapp/)
but with some shameless hackery I fixed this too:

def app_index(self, request, app_label, extra_context=None):
p = request.path.split('/')[-2].replace('_','-')
if p=='cms':
p='general-content'
elif p=='auth':
p='users'
return HttpResponseRedirect('/admin/#'+p)

(this basically redirects /admin/auth/ and /admin/cms/ to a named
anchor on the index page instead)

Andy

On Aug 16, 4:41 pm, Mathieu Leduc-Hamel  wrote:
> Hi all,
>
> I'm currently developing a e-commerce website using satchmo and
> django. I would like to simplify the admin pannel from the user
> perspective. This is why i would like to change the different group of
> models. Right now, these group are organized by application. But when
> using some external dependencies it some become a big mess to deal
> with so many different group of options.
>
> Is it possible
>
> There is a example of what i would like to do. There you have a part
> of my admin site hierarchy. I would like to move "Categories" and
> "Discounts" from the "Product" group to the "Store" group.
>
> auth
>   Groups
>   Users
> Contact
>   Persons
>   Organizations
> Product
>   Categories
>   Discounts
> Store
>   Style
>   Color
>   Size
>
> How can it be done ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Changing a model of place from the admin site

2010-08-16 Thread Mathieu Leduc-Hamel
Hi all,

I'm currently developing a e-commerce website using satchmo and
django. I would like to simplify the admin pannel from the user
perspective. This is why i would like to change the different group of
models. Right now, these group are organized by application. But when
using some external dependencies it some become a big mess to deal
with so many different group of options.

Is it possible

There is a example of what i would like to do. There you have a part
of my admin site hierarchy. I would like to move "Categories" and
"Discounts" from the "Product" group to the "Store" group.

auth
  Groups
  Users
Contact
  Persons
  Organizations
Product
  Categories
  Discounts
Store
  Style
  Color
  Size

How can it be done ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.