开发者

Jython Django1.3 admin panel pagination does not seem to work

开发者 https://www.devze.com 2023-03-27 16:33 出处:网络
i have a basic django-jython aplication which i am using admin panel on it, and it seems even if i declare the \'list_per_page = 25\' in my admin.py for each modeladmin class, it cant paginate the res

i have a basic django-jython aplication which i am using admin panel on it, and it seems even if i declare the 'list_per_page = 25' in my admin.py for each modeladmin class, it cant paginate the results. i have a table that contains 900.000 rows and django is trying to put all the rows in a one page. when i declare the 'list_per_page' option, it puts page numbers and total count of data below the page but then puts all the rows in every page. i know it sounds strange but i cant find any solution. Here is my Model class also here is my ModelAdmin code sample :

class MahalleAdmin ( admin.ModelAdmin ):
       list_display = ('KOD','AD','TIP','YETKILIIDAREKODU','KOYKODU')
       list_filter = ['AD','TIP','YETKILIIDAREKODU','KOYKODU']
       search_fields = ['KOD','AD','TIP','YETKILIIDAREKODU','KOYKODU']
       paginator     = paginator.Paginator
       list_per_page = 25


class MAHALLE_MERSIN ( models.Model ):

    class Meta:
        db_table              =  'MAHALLE_MERSIN'
        verbose_name          =  'MERSİN MAHALLELERİ'.decode('Latin5')
        verbose_name_plural   =  'MERSİN MAHALLELERİ'.decode('Latin5')
        #app_label = 'MESKİ ERP'.decode('Latin5')
    def __unicode__(self):
        return self.AD
    KOD                   = models.AutoField(primary_key = True)
    AD                    = models.CharF开发者_开发百科ield( max_length=512)
    TANITIMKODU           = models.IntegerField()
    TIP                   = models.ForeignKey(MAHALLE_TIP ,db_column= 'TIP')
    YETKILIIDAREKODU      = models.ForeignKey( KURUM , db_column='YETKILIIDAREKODU')
    KOYKODU               = models.ForeignKey(KOY_MERSIN  ,db_column= 'KOYKODU')


My guess is that you are running with the Django-Jython Oracle driver (doj.backends.zxjdbc.oracle), am I right? There is an issue with pagination in Oracle that I logged with the developer. It seems to be a problem only with the Oracle implementation of doj, the MySQL driver works fine.

Oracle Pagination in Admin interface

I really need to get this working for a project, so I'm gonna try to fix it myself and submit a patch. I will update you if/when it is fixed.

0

精彩评论

暂无评论...
验证码 换一张
取 消