1. Jesper Noehr
  2. django-piston
  3. Issues
Issue #23 open

set user to raw_id_field

Anonymous created an issue

model customer has a fk to user. with a large set of users, the admin-page won't load ... using a raw_id_field for the user solves this problem.

Comments (5)

  1. Anonymous

    I´m about to use an admin.py-file to register the models. within this file, I´ll use a raw_id_field ... currently, you use models.py to register the models for the admin-interface. I can send you admin.py once I´m finished.

  2. Anonymous

    remove admin.site.register from models.py add admin.py (see below)

    from my point of view, it´s good to have admin.py anway, since people may want to customize the admin-behaviour of piston.

    from django.contrib import admin
    from piston.models import Nonce, Resource, Consumer, Token
    class NonceOptions(admin.ModelAdmin):
    class ResourceOptions(admin.ModelAdmin):
    class ConsumerOptions(admin.ModelAdmin):
        raw_id_fields = ('user',)
    class TokenOptions(admin.ModelAdmin):
        raw_id_fields = ('user',)
    admin.site.register(Nonce, NonceOptions)
    admin.site.register(Resource, ResourceOptions)
    admin.site.register(Consumer, ConsumerOptions)
    admin.site.register(Token, TokenOptions)
  3. Log in to comment