Created
June 21, 2010 02:40
-
-
Save dannyroa/446318 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostAdmin(admin.ModelAdmin): | |
raw_id_fields = ['user'] | |
def add_view(self, request, form_url="", extra_context=None): | |
data = request.GET.copy() | |
data['user'] = request.user.id | |
data['status'] = POST_STATUS.APPROVED | |
request.GET = data | |
return super(PostAdmin, self).add_view(request, form_url="", extra_context=extra_context) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment