Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Mr Black
@lip177891840
Ao, Maybe I missed it . how can i set it to 30 for example
Mr Black
@lip177891840
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
class FooAdmin(admin.ModelAdmin):
    list_max_show_all = 500
    list_per_page = 200
Mr Black
@lip177891840
ok , let me hava a try :smile: thank you
Mr Black
@lip177891840
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
should i be familar with Django first ? just know a little about Django
xliiv
@xliiv
paste code using code formatter from markdown, ok?
Mr Black
@lip177891840
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
Forgive my mistake ,
Mateusz Kurek
@mkurek
@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
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
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
no ,
Jungle93
@Jungle93
Some newbee like me asking for adding pyldap to 'prod_ldap.txt'
Mr Black
@lip177891840
ok ,i see

i add

list_per_page = 2

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

xliiv
@xliiv
@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
thank you very much :smile: :smile: @mkurek
Jungle93
@Jungle93
@xliiv I see .may be something wrong with my pip3
Jungle93
@Jungle93
thx all,it work now.
bencheikh
@bencheikh
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
@bencheikh deb package?
Karsten Heymann
@kasimon
Hi! I'm trying to rebuild the ralph debian package myself from current git, but I run into an endless loop where the package minor version is constantly increased again and again. Is this a known problem? I'm trying it in a self-built debian jessie vagrant environment.
bencheikh
@bencheikh
@vi4m yes deb package
✪ vi4m Marcin Kliks
@vi4m
@bencheikh did you set export RALPH_DEBUG=1 ?
bencheikh
@bencheikh
yes i did it
✪ vi4m Marcin Kliks
@vi4m
check it twice, by executing export command
bencheikh
@bencheikh
Not working
✪ vi4m Marcin Kliks
@vi4m
what are the settings you use, then ?
bencheikh
@bencheikh
declare -x PATH="/opt/ralph/ralph-core/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"
declare -x PWD="/opt/ralph/ralph-core/bin"
declare -x RALPH_DEBUG="1"
which settings exactly ?
✪ vi4m Marcin Kliks
@vi4m
debian or ubuntu?
bencheikh
@bencheikh
debian jessie
✪ vi4m Marcin Kliks
@vi4m
and which package version?
bencheikh
@bencheikh
Debian 3.16.39-1+deb8u2 (2017-03-07) x86_64 GNU/Linux
✪ vi4m Marcin Kliks
@vi4m
dpkg -l ralph-core
bencheikh
@bencheikh
||/ Name Version Architecture Description
+++-===========================-==================-==================-============================================================
ii ralph-core 3.0.0-11 amd64 Ralph is an DCIM/CMDB - asset management for Data Centers/ B
✪ vi4m Marcin Kliks
@vi4m
this is a prehistoric ralph version
bencheikh
@bencheikh
Wich one should install
✪ vi4m Marcin Kliks
@vi4m
the latest (highest build)
bencheikh
@bencheikh
ralph-core_3.0.0-snapshot-20170120-7552_amd64.deb