On Sun, May 17, 2009 at 5:15 PM, Karen Tracey <kmtra...@gmail.com> wrote:
> On Sun, May 17, 2009 at 5:34 PM, Sergio A. <sergio.andreo...@gmail.com>wrote: > >> >> >> the issue seems not to be totally solved by the patch. >> >> If I have two classes A and B >> class A has a field being a foreign key to a B class field >> in the admin, when I add an A element, I see the '+' button on the >> foreign key field to B even though I do not have the rights to create >> a B element. >> Therefore I see a pop-up with permission denied. >> >> How to fix this? >> >> > That's a slightly different problem, and will need its own ticket. Despite > superficial similarity, hose "add another" links on the add/change pages for > an object are coming from completely different code than the other problem > mentioned in this thread. Specifically, they are added by the > RelatedFieldWidgetWrapper. From a quick look I'm not sure this one is going > to be easy to fix....I don't know that the widget wrapper has the necessary > information to decide whether to include that link. But you could open a > ticket for someone to take a closer look. > > Karen > > > > The widget doesn't really have the necessary info there. Specfically it needs the logged in user (or at least the computed info about them), however it's not going to have that since there's no way for the render() method to get that since it's not a part of the forms library. The best you could do is to pass it the widget constructor, which will be ok because of how we use the widgets in the admin, which will require a little bit of re-architecting. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---