Re: How to hack admin interface?...and should I?

2006-12-18 Thread patrick k.

hmm, I´ve never used a custom manager before.
most of the "hacking" stuff we do is about javascript and templates.

sorry, but I´m not able to help with this problem.

patrick

Am 18.12.2006 um 20:09 schrieb Picio:

>
> Patrick please, can you put an eye also here?
>
> http://paste.e-scribe.com/hold/2728/
>
> I'm trying to show only some rows in an admin results page.
>
> Can you help me find the reason whay I can't make It work?
> In particular no matter if I set a filter in the custom manager
> 'SoloCurrentUser'
> It still show me all the rows in the Admin !
> I've really tried everything and the python manage.py shell retrieve
> well the rows, with the query_set filtered.
>
> Is there any "fall back" manager that override my behaviour?
> How can I find a way to "destroy it"?
>
> Please note that all the relations from the model "operazione" are
> many-to-one, there are no Many to Many rel. in my model.
> I want to add that I've tried to override (like a blind in the  
> dark...):
> -get_result
> -get_ordering
> from the main View (ChangeList), nothing happen and of course the
> behaviour is the same.
>
> I know It's not a good thing to hack and customize the admin but  when
> you just have 1 or 2 things to change, It's not fair to rebuild
> (against the  DRY) another admin+1 little thing from scratch ! :)
>
>
> Thanks a lot for your patience.
> Please Help us.
> Picio
>
> 2006/12/18, Daniel Kvasnicka jr. <[EMAIL PROTECTED]>:
>>
>>> with the last couple of sites we did, we spent more time an  
>>> "hacking"
>>> the admin-interface than doing the actual site.
>>>
>>
>> Well, that's why I'll probably stick with TurboGears for that project
>> (I already have the admin interface almost implemented). I'll try
>> Django with another app. Thanks for replies.
>>
>> Dan
>>
>>
>>>
>>
>
> >


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



Re: How to hack admin interface?...and should I?

2006-12-18 Thread Picio

Patrick please, can you put an eye also here?

http://paste.e-scribe.com/hold/2728/

I'm trying to show only some rows in an admin results page.

Can you help me find the reason whay I can't make It work?
In particular no matter if I set a filter in the custom manager
'SoloCurrentUser'
It still show me all the rows in the Admin !
I've really tried everything and the python manage.py shell retrieve
well the rows, with the query_set filtered.

Is there any "fall back" manager that override my behaviour?
How can I find a way to "destroy it"?

Please note that all the relations from the model "operazione" are
many-to-one, there are no Many to Many rel. in my model.
I want to add that I've tried to override (like a blind in the dark...):
-get_result
-get_ordering
from the main View (ChangeList), nothing happen and of course the
behaviour is the same.

I know It's not a good thing to hack and customize the admin but  when
you just have 1 or 2 things to change, It's not fair to rebuild
(against the  DRY) another admin+1 little thing from scratch ! :)


Thanks a lot for your patience.
Please Help us.
Picio

2006/12/18, Daniel Kvasnicka jr. <[EMAIL PROTECTED]>:
>
> > with the last couple of sites we did, we spent more time an "hacking"
> > the admin-interface than doing the actual site.
> >
>
> Well, that's why I'll probably stick with TurboGears for that project
> (I already have the admin interface almost implemented). I'll try
> Django with another app. Thanks for replies.
>
> Dan
>
>
> >
>

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



Re: How to hack admin interface?...and should I?

2006-12-18 Thread Daniel Kvasnicka jr.

> with the last couple of sites we did, we spent more time an "hacking"
> the admin-interface than doing the actual site.
>

Well, that's why I'll probably stick with TurboGears for that project
(I already have the admin interface almost implemented). I'll try
Django with another app. Thanks for replies.

Dan


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



Re: How to hack admin interface?...and should I?

2006-12-18 Thread Aidas Bendoraitis

Daniel,

in your case, I would make the boolean field hidden using DHTML and
also add additional "Publish" button using DHTML which would check the
hidden checkbox before posting the form.

If Javascript is disabled, administrators would see the standard checkbox.

Good luck!
Aidas Bendoraitis aka Archatas



On 12/18/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>
>
> On 18-Dec-06, at 3:42 PM, [EMAIL PROTECTED] wrote:
>
> > The admin interface is just that, an interface for administration. If
> > you need something beyond that you should keep it outside of it. I
> > would give it a thumbs down on trying to "hack" the interface, modify
> > the templates, include pages that look the same, etc.. it's just too
> > time consuming.
>
> this is the official django position also. Admin is for the core
> administrators of the site - not for the general users - in fact this
> should be in the FAQ.
>
> --
>
> regards
> kg
> http://lawgon.livejournal.com
> http://nrcfosshelpline.in/web/
>
>
>
> >
>

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



Re: How to hack admin interface?...and should I?

2006-12-18 Thread patrick k.


Am 18.12.2006 um 11:30 schrieb Kenneth Gonsalves:

>
>
> On 18-Dec-06, at 3:42 PM, [EMAIL PROTECTED] wrote:
>
>> The admin interface is just that, an interface for administration. If
>> you need something beyond that you should keep it outside of it. I
>> would give it a thumbs down on trying to "hack" the interface, modify
>> the templates, include pages that look the same, etc.. it's just too
>> time consuming.
>
> this is the official django position also. Admin is for the core
> administrators of the site - not for the general users - in fact this
> should be in the FAQ.

because it´s for the core administrators doesn´t mean you shouldn´t  
add functionality or "hack" the interface (I actually never  
understood that argument).

I´d also give it a thumbs down, but only because the admin-interface  
is hard to hack.
but ... we still do that all the time. of course, when we add  
functionality for editors or administrators, it should look like the  
admin-interface.
with the last couple of sites we did, we spent more time an "hacking"  
the admin-interface than doing the actual site.

in my view, it all comes down on what you´re trying to achieve.

patrick


>
> -- 
>
> regards
> kg
> http://lawgon.livejournal.com
> http://nrcfosshelpline.in/web/
>
>
>
> >


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



Re: How to hack admin interface?...and should I?

2006-12-18 Thread Kenneth Gonsalves


On 18-Dec-06, at 3:42 PM, [EMAIL PROTECTED] wrote:

> The admin interface is just that, an interface for administration. If
> you need something beyond that you should keep it outside of it. I
> would give it a thumbs down on trying to "hack" the interface, modify
> the templates, include pages that look the same, etc.. it's just too
> time consuming.

this is the official django position also. Admin is for the core  
administrators of the site - not for the general users - in fact this  
should be in the FAQ.

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



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



Re: How to hack admin interface?...and should I?

2006-12-18 Thread [EMAIL PROTECTED]

The admin interface is just that, an interface for administration. If
you need something beyond that you should keep it outside of it. I
would give it a thumbs down on trying to "hack" the interface, modify
the templates, include pages that look the same, etc.. it's just too
time consuming.

My two cents.

On Dec 18, 11:01 am, "Daniel Kvasnicka jr."
<[EMAIL PROTECTED]> wrote:
> Thanks for reply,
> I also wanted to ask how would one implement a "approving mechanism". I
> have a boolean field which says whether an article has been published
> or not. And I need to have a "Publish" button with each article entry,
> available only to admins. Does Django support something like this? I
> just don't want force editors to change 0 to 1 (or False to True,
> whatever...) when they want to send an article to the frontpage...
> Another thing is that I need to allow authors to write and edit
> articles but not publish them but -- wouldn't the approving action be
> taken as a regular "edit" permission level?
> So, provided this all, is it more productive to hack that functionality
> to Django admin or to write a standalone app for this?
>
> Thanks,
> Dan
>
> On Dec 14, 5:55 pm, "va:patrick.kranzlmueller"
>
> <[EMAIL PROTECTED]> wrote:
> > Am 14.12.2006 um 17:05 schrieb Daniel Kvasnicka jr.:
>
> > > Hi djangees,
> > > I'm a TurboGears user, I like CherryPy, Kid and so. I like Django as
> > > well and tried the tutorials.
> > > What I like about Django is (obviously) the auto-generated admin
> > > interface.
>
> > > However, what I need to know is how
> > > easy/difficult/deprecated/encouraged is to hack the auto-generated
> > > admin interface. I'm doing this app, where our customers login and
> > > vote
> > > for features that we plan to implement in our services. And besides
> > > CRUD, I need to enable my boss to login and view a whole bunch of
> > > stats
> > > about who voted for what and how is that particular guy important for
> > > us etc... So, my question is, how easy would it be to "add a page" to
> > > admin, that would have the same auth restrictions, same GUI but would
> > > only display bars and graphs generated from the DB? Or would you write
> > > an admin section from scratch in that case?write custom views (or use 
> > > generic views).
> > making your site _look_ like the admin is probably harder than
> > writing the views.
>
> > adding a page to the admin is quite easy though:
> > just extend the index-template and link to your site ... and don´t
> > forget to use
> > myview = staff_member_required(never_cache(myview))
>
> > patrick
>
> > > Right now I'm writing everything on my own in TurboGears. It's not
> > > bad,
> > > since auth/auth management is pretty intuitive in TG, but it's kinda
> > > boring...
> 
> > > Thanks for your opinions,
> > > Dan


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



Re: How to hack admin interface?...and should I?

2006-12-18 Thread Daniel Kvasnicka jr.

Thanks for reply,
I also wanted to ask how would one implement a "approving mechanism". I
have a boolean field which says whether an article has been published
or not. And I need to have a "Publish" button with each article entry,
available only to admins. Does Django support something like this? I
just don't want force editors to change 0 to 1 (or False to True,
whatever...) when they want to send an article to the frontpage...
Another thing is that I need to allow authors to write and edit
articles but not publish them but -- wouldn't the approving action be
taken as a regular "edit" permission level?
So, provided this all, is it more productive to hack that functionality
to Django admin or to write a standalone app for this?

Thanks,
Dan

On Dec 14, 5:55 pm, "va:patrick.kranzlmueller"
<[EMAIL PROTECTED]> wrote:
> Am 14.12.2006 um 17:05 schrieb Daniel Kvasnicka jr.:
>
>
>
>
>
> > Hi djangees,
> > I'm a TurboGears user, I like CherryPy, Kid and so. I like Django as
> > well and tried the tutorials.
> > What I like about Django is (obviously) the auto-generated admin
> > interface.
>
> > However, what I need to know is how
> > easy/difficult/deprecated/encouraged is to hack the auto-generated
> > admin interface. I'm doing this app, where our customers login and
> > vote
> > for features that we plan to implement in our services. And besides
> > CRUD, I need to enable my boss to login and view a whole bunch of
> > stats
> > about who voted for what and how is that particular guy important for
> > us etc... So, my question is, how easy would it be to "add a page" to
> > admin, that would have the same auth restrictions, same GUI but would
> > only display bars and graphs generated from the DB? Or would you write
> > an admin section from scratch in that case?write custom views (or use 
> > generic views).
> making your site _look_ like the admin is probably harder than
> writing the views.
>
> adding a page to the admin is quite easy though:
> just extend the index-template and link to your site ... and don´t
> forget to use
> myview = staff_member_required(never_cache(myview))
>
> patrick
>
>
>
> > Right now I'm writing everything on my own in TurboGears. It's not
> > bad,
> > since auth/auth management is pretty intuitive in TG, but it's kinda
> > boring...
> 
> > Thanks for your opinions,
> > Dan


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



Re: How to hack admin interface?...and should I?

2006-12-14 Thread va:patrick.kranzlmueller


Am 14.12.2006 um 17:05 schrieb Daniel Kvasnicka jr.:

>
> Hi djangees,
> I'm a TurboGears user, I like CherryPy, Kid and so. I like Django as
> well and tried the tutorials.
> What I like about Django is (obviously) the auto-generated admin
> interface.
>
> However, what I need to know is how
> easy/difficult/deprecated/encouraged is to hack the auto-generated
> admin interface. I'm doing this app, where our customers login and  
> vote
> for features that we plan to implement in our services. And besides
> CRUD, I need to enable my boss to login and view a whole bunch of  
> stats
> about who voted for what and how is that particular guy important for
> us etc... So, my question is, how easy would it be to "add a page" to
> admin, that would have the same auth restrictions, same GUI but would
> only display bars and graphs generated from the DB? Or would you write
> an admin section from scratch in that case?

write custom views (or use generic views).
making your site _look_ like the admin is probably harder than  
writing the views.

adding a page to the admin is quite easy though:
just extend the index-template and link to your site ... and don´t  
forget to use
myview = staff_member_required(never_cache(myview))

patrick


>
> Right now I'm writing everything on my own in TurboGears. It's not  
> bad,
> since auth/auth management is pretty intuitive in TG, but it's kinda
> boring...
>
> Thanks for your opinions,
> Dan
>
>
> >


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



How to hack admin interface?...and should I?

2006-12-14 Thread Daniel Kvasnicka jr.

Hi djangees,
I'm a TurboGears user, I like CherryPy, Kid and so. I like Django as
well and tried the tutorials.
What I like about Django is (obviously) the auto-generated admin
interface.

However, what I need to know is how
easy/difficult/deprecated/encouraged is to hack the auto-generated
admin interface. I'm doing this app, where our customers login and vote
for features that we plan to implement in our services. And besides
CRUD, I need to enable my boss to login and view a whole bunch of stats
about who voted for what and how is that particular guy important for
us etc... So, my question is, how easy would it be to "add a page" to
admin, that would have the same auth restrictions, same GUI but would
only display bars and graphs generated from the DB? Or would you write
an admin section from scratch in that case?

Right now I'm writing everything on my own in TurboGears. It's not bad,
since auth/auth management is pretty intuitive in TG, but it's kinda
boring...

Thanks for your opinions,
Dan


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