Hi all, I do have various models with ForeignKey(Site). These models should be managed through Admin. However, I would like to determine the current site based on the URL (which basically means it needs to be defined in the view based on the request object). However, he current default behaviour of admin is that it displays the site field and lets the user choose the site. My requirements are: 1. The user will only ever see objects for the current site (derived from the URL following a certain logic) 2. The user will NOT see the site field (since it is not relevant for him) 3. The user will NOT be able to choose a site when updating or adding objects, but the site will be assigned in the background programmatically
My solutions so far are: 1. I adapted queryset() to filter on the current site ==> so I think that box is ticked 2. I adapted the fields attribute ==> so this works for the list view, but not in the detail view (change view) and not in the add view 3. I have no clue how to get that one. Any help is highly appreciated. Thanks a lot schacki -- 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.