Skip to content

Commit

Permalink
fix import bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
zts0813 committed Apr 3, 2016
1 parent 3ab7f55 commit bf511e5
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion xadmin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

VERSION = [0,5,0]

from xadmin.sites import AdminSite, site

class Settings(object):
pass
Expand All @@ -16,7 +17,6 @@ def autodiscover():
from importlib import import_module
from django.conf import settings
from django.utils.module_loading import module_has_submodule
from xadmin.sites import AdminSite, site
setattr(settings, 'CRISPY_TEMPLATE_PACK', 'bootstrap3')
setattr(settings, 'CRISPY_CLASS_CONVERTERS', {
"textinput": "textinput textInput form-control",
Expand Down
2 changes: 1 addition & 1 deletion xadmin/adminx.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class UserSettingsAdmin(object):
model_icon = 'fa fa-cog'
hidden_menu = True

xadmin.sites.site.register(UserSettings, UserSettingsAdmin)
xadmin.site.register(UserSettings, UserSettingsAdmin)
2 changes: 1 addition & 1 deletion xadmin/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class XAdminConfig(AppConfig):

def ready(self):
self.module.autodiscover()
setattr(xadmin,'site',xadmin.sites.site)
setattr(xadmin,'site',xadmin.site)
2 changes: 1 addition & 1 deletion xadmin/plugins/comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ def _bulk_flag(self, queryset, action, done_message):
# Only register the default admin if the model is the built-in comment model
# (this won't be true if there's a custom comment app).
if 'django.contrib.comments' in settings.INSTALLED_APPS and (get_model() is Comment):
xadmin.sites.site.register(Comment, CommentsAdmin)
xadmin.site.register(Comment, CommentsAdmin)
2 changes: 1 addition & 1 deletion xadmin/plugins/multiselect.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ def get_field_style(self, attrs, db_field, style, **kwargs):
return attrs


xadmin.sites.site.register_plugin(M2MSelectPlugin, ModelFormAdminView)
xadmin.site.register_plugin(M2MSelectPlugin, ModelFormAdminView)
2 changes: 1 addition & 1 deletion xadmin/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, name='xadmin'):

self._admin_view_cache = {}

self.check_dependencies()
#self.check_dependencies()

self.model_admins_order = 0

Expand Down
8 changes: 6 additions & 2 deletions xadmin/static/xadmin/css/xadmin.form.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ select.selectmultiple {
{
max-width: 300px;
}
.input-group.date{ max-width: 220px;}
.input-group.date{ max-width: 300px;}
.input-group.time{ max-width: 180px;}
.int-field {
max-width: 100px;
Expand Down Expand Up @@ -144,6 +144,10 @@ select.selectmultiple {
padding-left: 0px;
padding-right: 0px;
}
.form-horizontal .form-inline .form-control{
min-width:200px;
max-width:300px;
}
.form-horizontal .fieldset .panel-body {
padding-top: 24px;
}
Expand Down Expand Up @@ -187,4 +191,4 @@ img.field_img {
/** tabs **/
.nav.nav-tabs {
margin-bottom: 15px;
}
}
4 changes: 2 additions & 2 deletions xadmin/templates/xadmin/blocks/comm.top.setlang.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% load i18n xadmin_tags %}


<li class="dropdown g-setlang">
<a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">
<i class="fa fa-globe"></i> <span class="hide-sm">
{% get_language_info for LANGUAGE_CODE as l %}{{ l.name_local }}
{{LANGUAGE_CODE}}
{# get_language_info for LANGUAGE_CODE as l %}{{ l.name_local #}
<i class="caret"></i></span></a>
<form id="setlang-form" action="{% url 'xadmin:django.views.i18n.set_language' %}" method="post" style="display:none;">
{% csrf_token %}
Expand Down
1 change: 0 additions & 1 deletion xadmin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ def display_for_value(value, boolean=False):
class NotRelationField(Exception):
pass


def get_model_from_relation(field):
if is_related_field(field):
return field.model
Expand Down

0 comments on commit bf511e5

Please sign in to comment.