These are chat archives for allegro/ralph

10th
May 2017
Mr Black
@lip177891840
May 10 2017 01:28
Ao, Maybe I missed it . how can i set it to 30 for example
Mr Black
@lip177891840
May 10 2017 07:29
now,I found that ralph used LimitOffsetPagination
the default code is:
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', # noqa
'PAGE_SIZE': 10,
but it is still 100 items in my page,
✪ vi4m Marcin Kliks
@vi4m
May 10 2017 08:20
class FooAdmin(admin.ModelAdmin):
    list_max_show_all = 500
    list_per_page = 200
Mr Black
@lip177891840
May 10 2017 08:30
ok , let me hava a try :smile: thank you
Mr Black
@lip177891840
May 10 2017 09:27
well, I add like this (file ralph/src/ralph/tests/admin.py) :
@register(Foo)
class FooAdmin(RalphAdmin):
inlines = [BarsM2MInline]
list_filter = ['bar']
list_max_show_all = 500
list_per_page = 2
and run "dev_ralph migrate",but dosent work ,
I also used 'grep' to find the variate in the project,it appears in another file ralph/src/ralph/admin/tests/tests_functional.py like this :
list_max_show_all=model_admin.list_max_show_all,
list_per_page=model_admin.list_per_page,
list_select_related=model_admin.list_select_related,
search_fields=model_admin.search_fields,
and I made it changed,It still didnt work. :worried: :worried: :worried:
Mr Black
@lip177891840
May 10 2017 09:35
should i be familar with Django first ? just know a little about Django
xliiv
@xliiv
May 10 2017 09:37
paste code using code formatter from markdown, ok?
Mr Black
@lip177891840
May 10 2017 09:39
ok ,,

well, I add like this (file ralph/src/ralph/tests/admin.py) :
@register(Foo)

class FooAdmin(RalphAdmin):
inlines = [BarsM2MInline]
list_filter = ['bar']
list_max_show_all = 500
list_per_page = 2

and run "dev_ralph migrate",but dosent work ,
I also used 'grep' to find the variate in the project,it appears in another file ralph/src/ralph/admin/tests/tests_functional.py like this :

list_max_show_all=model_admin.list_max_show_all,
list_per_page=model_admin.list_per_page,
list_select_related=model_admin.list_select_related,
search_fields=model_admin.search_fields,

and I made it changed,It still didnt work.

Mr Black
@lip177891840
May 10 2017 09:45
Forgive my mistake ,
Mateusz Kurek
@mkurek
May 10 2017 09:51
@lip177891840 let's start with such question: what is your goal? What are you trying to achieve? :) Are you adding new admin view for your custom model?
Mr Black
@lip177891840
May 10 2017 09:59
ok, my goal is that changing the style only,not adding new view .like the filter style i changed ,and now I want to chang 50 items per page rather than 100 as dafult
here is my filter style :smile:
123.PNG
Mateusz Kurek
@mkurek
May 10 2017 10:01
if you want 50 items per page just set list_per_page = 50 in RalphAdmin class
ok - do you have you own changelist template?
Mr Black
@lip177891840
May 10 2017 10:02
no ,
Jungle93
@Jungle93
May 10 2017 10:05
Some newbee like me asking for adding pyldap to 'prod_ldap.txt'
Mr Black
@lip177891840
May 10 2017 10:07
ok ,i see

i add

list_per_page = 2

in class RalphAdmin,and it worked :smile:
I mistaked class FooAdmin, :worried:

xliiv
@xliiv
May 10 2017 10:09
@Jungle93 are you sure you're installing ralph with python3? because pyldap should be installed duo to https://bitbucket.org/psagers/django-auth-ldap/src/e281a690254c3b934e3fcb4c6a2071e988a6f78b/setup.py?at=1.2.7&fileviewer=file-view-default
Mr Black
@lip177891840
May 10 2017 10:10
thank you very much :smile: :smile: @mkurek
Jungle93
@Jungle93
May 10 2017 10:15
@xliiv I see .may be something wrong with my pip3
Jungle93
@Jungle93
May 10 2017 12:11
thx all,it work now.
bencheikh
@bencheikh
May 10 2017 14:05
Hello
i have a problem
[10/May/2017 15:33:18]"GET /static/admin/css/changelists.css HTTP/1.1" 404 106
[10/May/2017 15:33:18]"GET /static/vendor/css/foundation-datepicker.css HTTP/1.1" 404 117
[10/May/2017 15:33:18]"GET /static/css/ralph.css HTTP/1.1" 404 94
[10/May/2017 15:33:18]"GET /static/vendor/js/jquery.js HTTP/1.1" 404 100
[10/May/2017 15:33:18]"GET /static/vendor/js/foundation.min.js HTTP/1.1" 404 108
No Image.png
No image
✪ vi4m Marcin Kliks
@vi4m
May 10 2017 14:59
@bencheikh deb package?