Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
✪ vi4m Marcin Kliks
@vi4m
ok!
what are you going to add to ralph? some servers / switches ?
Jim Ntosas
@purplexss
i ll contribute systemd service conf and ansible role for ubuntu/debian as soon as i finish deployment :)
yes, servers, switches, back office
we found it cool and trying it out, after a week or two of testing maybe we deploy it as production asset and dc management
✪ vi4m Marcin Kliks
@vi4m
great news ! :clap:
Jim Ntosas
@purplexss
now going to make and ldap sync try, as soon as i got news i can get you feedback as well as some donation (needs manager approve :P)
Jim Ntosas
@purplexss
thanks a lot for your help !
✪ vi4m Marcin Kliks
@vi4m
oh man, our bintray packages got stuck :-(
Zrzut ekranu 2017-05-04 o 17.41.03.png
Mr Black
@lip177891840
hello?
✪ vi4m Marcin Kliks
@vi4m
Hi
Mr Black
@lip177891840
i am new to here,
also a beginner to Django, want to seek help from you
Mr Black
@lip177891840
here is my problem,
I want to add pagination to the result_list ,but i dont know how to turn on the switch in the pagination.html --(/ralph/src/ralph/admin/templates/adminpagination.html)
the code is :
{% if page_range %}
<div class="row">
<div class="small-12 columns pagination-centered">
<ul class="pagination">
{% if pagination_required %}
{% for i in page_range %}
{% admin_paginator_number cl i %}
{% endfor %}
{% endif %}
</ul>
</div>
</div>
{% endif %}
捕获1.PNG
Mr Black
@lip177891840
i think that the variate (page_range, pagination_required) shuold be settd in the view (MVC),
but i cant found any view i used in simple demo in ralph.
✪ vi4m Marcin Kliks
@vi4m
didn't assets already have pagination ?
yes, we did pagination for listings
@lip177891840 we set it to 100 records
Zrzut ekranu 2017-05-09 o 14.32.37.png
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