diff --git a/.gitignore b/.gitignore index 1e9fa8329..e10040522 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ # C extensions *.so +htmlcov + # Packages *.egg *.egg-info @@ -17,6 +19,8 @@ develop-eggs .installed.cfg lib lib64 +venv +venv3 # Installer logs pip-log.txt diff --git a/demo_app/.gitignore b/demo_app/.gitignore new file mode 100644 index 000000000..7f6e2c4b3 --- /dev/null +++ b/demo_app/.gitignore @@ -0,0 +1,2 @@ +db.sqlite3 +db3.sqlite3 \ No newline at end of file diff --git a/demo_app/app/adminx.py b/demo_app/app/adminx.py index 7f50f9c06..9cf87bfaa 100644 --- a/demo_app/app/adminx.py +++ b/demo_app/app/adminx.py @@ -8,7 +8,7 @@ @xadmin.sites.register(views.website.IndexView) -class MainDashboard(object): +class MainDashboard: widgets = [ [ {"type": "html", "title": "Test Widget", @@ -26,13 +26,13 @@ class MainDashboard(object): @xadmin.sites.register(views.BaseAdminView) -class BaseSetting(object): +class BaseSetting: enable_themes = True use_bootswatch = True @xadmin.sites.register(views.CommAdminView) -class GlobalSetting(object): +class GlobalSetting: global_search_models = [Host, IDC] global_models_icon = { Host: "fa fa-laptop", IDC: "fa fa-cloud" @@ -40,14 +40,14 @@ class GlobalSetting(object): menu_style = 'default' # 'accordion' -class MaintainInline(object): +class MaintainInline: model = MaintainLog extra = 1 style = "accordion" @xadmin.sites.register(IDC) -class IDCAdmin(object): +class IDCAdmin: list_display = ("name", "description", "create_time", "contact", "telphone", "address", "customer_id") list_display_links = ("name",) wizard_form_list = [ @@ -70,7 +70,7 @@ class IDCAdmin(object): @xadmin.sites.register(Host) -class HostAdmin(object): +class HostAdmin: def open_web(self, instance): return """Open""" % instance.ip @@ -150,7 +150,7 @@ def open_web(self, instance): reversion_enable = True data_charts = { - "host_service_type_counts": {'title': u"Host service type count", "x-field": "service_type", + "host_service_type_counts": {'title': "Host service type count", "x-field": "service_type", "y-field": ("service_type",), "option": { "series": {"bars": {"align": "center", "barWidth": 0.8, 'show': True}}, @@ -161,7 +161,7 @@ def open_web(self, instance): @xadmin.sites.register(HostGroup) -class HostGroupAdmin(object): +class HostGroupAdmin: list_display = ("name", "description") list_display_links = ("name",) @@ -171,7 +171,7 @@ class HostGroupAdmin(object): @xadmin.sites.register(MaintainLog) -class MaintainLogAdmin(object): +class MaintainLogAdmin: list_display = ( "host", "maintain_type", "hard_type", "time", "operator", "note") list_display_links = ("host",) @@ -201,7 +201,7 @@ class MaintainLogAdmin(object): @xadmin.sites.register(AccessRecord) -class AccessRecordAdmin(object): +class AccessRecordAdmin: def avg_count(self, instance): return int(instance.view_count / instance.user_count) @@ -219,10 +219,10 @@ def avg_count(self, instance): refresh_times = (3, 5, 10) data_charts = { - "user_count": {'title': u"User Report", "x-field": "date", "y-field": ("user_count", "view_count"), + "user_count": {'title': "User Report", "x-field": "date", "y-field": ("user_count", "view_count"), "order": ('date',)}, - "avg_count": {'title': u"Avg Report", "x-field": "date", "y-field": ('avg_count',), "order": ('date',)}, - "per_month": {'title': u"Monthly Users", "x-field": "_chart_month", "y-field": ("user_count",), + "avg_count": {'title': "Avg Report", "x-field": "date", "y-field": ('avg_count',), "order": ('date',)}, + "per_month": {'title': "Monthly Users", "x-field": "_chart_month", "y-field": ("user_count",), "option": { "series": {"bars": {"align": "center", "barWidth": 0.8, 'show': True}}, "xaxis": {"aggregate": "sum", "mode": "categories"}, diff --git a/demo_app/app/migrations/0004_auto_20190813_0916.py b/demo_app/app/migrations/0004_auto_20190813_0916.py new file mode 100644 index 000000000..4b18faa53 --- /dev/null +++ b/demo_app/app/migrations/0004_auto_20190813_0916.py @@ -0,0 +1,36 @@ +# Generated by Django 2.2.4 on 2019-08-13 12:16 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ('app', '0003_host_administrator'), + ] + + operations = [ + migrations.AlterField( + model_name='host', + name='administrator', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, + verbose_name='Admin'), + ), + migrations.AlterField( + model_name='host', + name='core_num', + field=models.SmallIntegerField( + choices=[(2, '2 Cores'), (4, '4 Cores'), (6, '6 Cores'), (8, '8 Cores'), (10, '10 Cores'), + (12, '12 Cores'), (14, '14 Cores'), (16, '16 Cores'), (18, '18 Cores'), (20, '20 Cores'), + (22, '22 Cores'), (24, '24 Cores'), (26, '26 Cores'), (28, '28 Cores')]), + ), + migrations.AlterField( + model_name='host', + name='service_type', + field=models.CharField( + choices=[('moniter', 'Moniter'), ('lvs', 'LVS'), ('db', 'Database'), ('analysis', 'Analysis'), + ('admin', 'Admin'), ('storge', 'Storge'), ('web', 'WEB'), ('email', 'Email'), ('mix', 'Mix')], + max_length=32), + ), + ] diff --git a/demo_app/app/migrations/0005_idc_is_valid.py b/demo_app/app/migrations/0005_idc_is_valid.py new file mode 100644 index 000000000..4fb29b680 --- /dev/null +++ b/demo_app/app/migrations/0005_idc_is_valid.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.23 on 2019-09-05 13:57 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('app', '0004_auto_20190813_0916'), + ] + + operations = [ + migrations.AddField( + model_name='idc', + name='is_valid', + field=models.BooleanField(default=False), + ), + ] diff --git a/demo_app/app/migrations/0006_remove_idc_is_valid.py b/demo_app/app/migrations/0006_remove_idc_is_valid.py new file mode 100644 index 000000000..cfed0b3f2 --- /dev/null +++ b/demo_app/app/migrations/0006_remove_idc_is_valid.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.16 on 2020-10-27 14:55 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('app', '0005_idc_is_valid'), + ] + + operations = [ + migrations.RemoveField( + model_name='idc', + name='is_valid', + ), + ] diff --git a/demo_app/app/models.py b/demo_app/app/models.py index 430b6370a..4f193f726 100644 --- a/demo_app/app/models.py +++ b/demo_app/app/models.py @@ -6,21 +6,21 @@ AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') SERVER_STATUS = ( - (0, u"Normal"), - (1, u"Down"), - (2, u"No Connect"), - (3, u"Error"), + (0, "Normal"), + (1, "Down"), + (2, "No Connect"), + (3, "Error"), ) SERVICE_TYPES = ( - ('moniter', u"Moniter"), - ('lvs', u"LVS"), - ('db', u"Database"), - ('analysis', u"Analysis"), - ('admin', u"Admin"), - ('storge', u"Storge"), - ('web', u"WEB"), - ('email', u"Email"), - ('mix', u"Mix"), + ('moniter', "Moniter"), + ('lvs', "LVS"), + ('db', "Database"), + ('analysis', "Analysis"), + ('admin', "Admin"), + ('storge', "Storge"), + ('web', "WEB"), + ('email', "Email"), + ('mix', "Mix"), ) @@ -41,7 +41,7 @@ def __str__(self): return self.name class Meta: - verbose_name = u"IDC" + verbose_name = "IDC" verbose_name_plural = verbose_name @@ -49,7 +49,7 @@ class Meta: class Host(models.Model): idc = models.ForeignKey(IDC, on_delete=models.CASCADE) name = models.CharField(max_length=64) - nagios_name = models.CharField(u"Nagios Host ID", max_length=64, blank=True, null=True) + nagios_name = models.CharField("Nagios Host ID", max_length=64, blank=True, null=True) ip = models.GenericIPAddressField(blank=True, null=True) internal_ip = models.GenericIPAddressField(blank=True, null=True) user = models.CharField(max_length=64) @@ -57,16 +57,16 @@ class Host(models.Model): ssh_port = models.IntegerField(blank=True, null=True) status = models.SmallIntegerField(choices=SERVER_STATUS) - brand = models.CharField(max_length=64, choices=[(i, i) for i in (u"DELL", u"HP", u"Other")]) + brand = models.CharField(max_length=64, choices=[(i, i) for i in ("DELL", "HP", "Other")]) model = models.CharField(max_length=64) cpu = models.CharField(max_length=64) core_num = models.SmallIntegerField(choices=[(i * 2, "%s Cores" % (i * 2)) for i in range(1, 15)]) hard_disk = models.IntegerField() memory = models.IntegerField() - system = models.CharField(u"System OS", max_length=32, choices=[(i, i) for i in (u"CentOS", u"FreeBSD", u"Ubuntu")]) + system = models.CharField("System OS", max_length=32, choices=[(i, i) for i in ("CentOS", "FreeBSD", "Ubuntu")]) system_version = models.CharField(max_length=32) - system_arch = models.CharField(max_length=32, choices=[(i, i) for i in (u"x86_64", u"i386")]) + system_arch = models.CharField(max_length=32, choices=[(i, i) for i in ("x86_64", "i386")]) create_time = models.DateField() guarantee_date = models.DateField() @@ -79,7 +79,7 @@ def __str__(self): return self.name class Meta: - verbose_name = u"Host" + verbose_name = "Host" verbose_name_plural = verbose_name @@ -97,7 +97,7 @@ def __str__(self): self.maintain_type, self.hard_type) class Meta: - verbose_name = u"Maintain Log" + verbose_name = "Maintain Log" verbose_name_plural = verbose_name @@ -110,7 +110,7 @@ class HostGroup(models.Model): Host, verbose_name=u'Hosts', blank=True, related_name='groups') class Meta: - verbose_name = u"Host Group" + verbose_name = "Host Group" verbose_name_plural = verbose_name def __str__(self): @@ -124,7 +124,7 @@ class AccessRecord(models.Model): view_count = models.IntegerField() class Meta: - verbose_name = u"Access Record" + verbose_name = "Access Record" verbose_name_plural = verbose_name def __str__(self): diff --git a/demo_app/demo/settings.py b/demo_app/demo/settings.py index 75933f3b1..4fb9471e1 100644 --- a/demo_app/demo/settings.py +++ b/demo_app/demo/settings.py @@ -27,10 +27,14 @@ LANGUAGES = ( ('en', _('English')), ('zh-hans', _('Chinese')), + ('pt-br', _('Portuguese')), ) ALLOWED_HOSTS = [] +# SITE_ID = 1 +# extra optional plugin +# XADMIN_INCLUDE_PLUGINS = ('comments',) # Application definition @@ -41,7 +45,8 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - + # 'django.contrib.sites', + # 'django_comments', 'xadmin', 'crispy_forms', 'reversion', @@ -57,6 +62,7 @@ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.locale.LocaleMiddleware' ] ROOT_URLCONF = 'demo.urls' @@ -68,6 +74,10 @@ 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ + 'django.template.context_processors.i18n', + 'django.template.context_processors.media', + 'django.template.context_processors.static', + 'django.template.context_processors.tz', 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', @@ -79,7 +89,6 @@ WSGI_APPLICATION = 'demo.wsgi.application' - # Database # https://docs.djangoproject.com/en/2.0/ref/settings/#databases @@ -113,7 +122,7 @@ # Internationalization # https://docs.djangoproject.com/en/2.0/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = 'en' TIME_ZONE = 'UTC' diff --git a/setup.py b/setup.py index ae631e6b3..dedaa14d8 100644 --- a/setup.py +++ b/setup.py @@ -20,10 +20,10 @@ 'setuptools', 'django>=2', 'django-crispy-forms>=1.6.0', + 'django-import-export>=0.5.1', 'django-reversion>=2.0.0', 'django-formtools>=1.0', - 'django-import-export>=0.5.1', - 'httplib2==0.9.2', + 'httplib2==0.18.1', 'future', 'six' ], diff --git a/tests/runtests.py b/tests/runtests.py index 5f8677b25..3a1fd9d98 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -1,15 +1,14 @@ #!/usr/bin/env python from __future__ import print_function + import os import shutil import sys import tempfile import django -from django.apps import AppConfig,apps from django.utils.encoding import smart_text - TEST_ROOT = os.path.realpath(os.path.dirname(__file__)) RUNTESTS_DIR = os.path.join(TEST_ROOT, 'xtests') @@ -26,11 +25,14 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + # required to use import-export plugin + 'django.contrib.admin', 'xadmin', 'crispy_forms', ] + def get_test_modules(): modules = [] for f in os.listdir(RUNTESTS_DIR): @@ -40,17 +42,17 @@ def get_test_modules(): or f.startswith('.') or f.startswith('sql') or not os.path.isdir(os.path.join(RUNTESTS_DIR, f)) - ): + ): continue modules.append(f) return modules + def setup(verbosity, test_labels): from django.conf import settings state = { 'INSTALLED_APPS': settings.INSTALLED_APPS, 'ROOT_URLCONF': getattr(settings, "ROOT_URLCONF", ""), - 'TEMPLATE_DIRS': settings.TEMPLATE_DIRS, 'USE_I18N': settings.USE_I18N, 'LOGIN_URL': settings.LOGIN_URL, 'LANGUAGE_CODE': settings.LANGUAGE_CODE, @@ -64,7 +66,10 @@ def setup(verbosity, test_labels): settings.ROOT_URLCONF = 'urls' settings.STATIC_URL = '/static/' settings.STATIC_ROOT = os.path.join(TEMP_DIR, 'static') - settings.TEMPLATE_DIRS = (os.path.join(RUNTESTS_DIR, TEST_TEMPLATE_DIR),) + for engine in settings.TEMPLATES: + engine['DIRS'].extend([ + os.path.join(RUNTESTS_DIR, TEST_TEMPLATE_DIR) + ]) settings.USE_I18N = True settings.LANGUAGE_CODE = 'en' settings.MIDDLEWARE_CLASSES = ( @@ -83,7 +88,6 @@ def setup(verbosity, test_labels): # (This import statement is intentionally delayed until after we # access settings because of the USE_I18N dependency.) - # Load all the test model apps. test_labels_set = set([label.split('.')[0] for label in test_labels]) test_modules = get_test_modules() @@ -99,9 +103,9 @@ def setup(verbosity, test_labels): settings.INSTALLED_APPS.append(module_label) django.setup() - [a.models_module for a in apps.get_app_configs()] return state + def teardown(state): from django.conf import settings # Removing the temporary TEMP_DIR. Ensure we pass in unicode @@ -113,6 +117,7 @@ def teardown(state): for key, value in state.items(): setattr(settings, key, value) + def django_tests(verbosity, interactive, failfast, test_labels): from django.conf import settings state = setup(verbosity, test_labels) @@ -125,18 +130,20 @@ def django_tests(verbosity, interactive, failfast, test_labels): TestRunner = get_runner(settings) test_runner = TestRunner(verbosity=verbosity, interactive=interactive, - failfast=failfast) + failfast=failfast) failures = test_runner.run_tests(test_labels or get_test_modules(), extra_tests=extra_tests) teardown(state) return failures + if __name__ == "__main__": from optparse import OptionParser + usage = "%prog [options] [module module module ...]" parser = OptionParser(usage=usage) parser.add_option( - '-v','--verbosity', action='store', dest='verbosity', default='1', + '-v', '--verbosity', action='store', dest='verbosity', default='1', type='choice', choices=['0', '1', '2', '3'], help='Verbosity level; 0=minimal output, 1=normal output, 2=all ' 'output') diff --git a/tests/urls.py b/tests/urls.py index 28b9250d2..fd3af1885 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -1,5 +1,5 @@ -from django.conf.urls import patterns, include +from django.urls import path, include -urlpatterns = patterns('', - (r'^view_base/', include('view_base.urls')), -) \ No newline at end of file +urlpatterns = [ + path(r'view_base/', include('view_base.urls')), +] diff --git a/tests/xtests/base.py b/tests/xtests/base.py index d69ecad29..2d896c8c1 100644 --- a/tests/xtests/base.py +++ b/tests/xtests/base.py @@ -1,7 +1,8 @@ -from django.test import TestCase from django.contrib.auth.models import User +from django.test import TestCase from django.test.client import RequestFactory + class BaseTest(TestCase): def setUp(self): @@ -14,4 +15,4 @@ def _mocked_request(self, url, user='admin'): request = self.factory.get(url) request.user = isinstance(user, User) and user or self._create_superuser(user) request.session = {} - return request \ No newline at end of file + return request diff --git a/tests/xtests/site/apps.py b/tests/xtests/site/apps.py index 37777566c..01b739db5 100644 --- a/tests/xtests/site/apps.py +++ b/tests/xtests/site/apps.py @@ -1,13 +1,17 @@ #!/usr/bin/env python -#coding:utf-8 +# coding:utf-8 import sys + from django.utils import six -if six.PY2 and sys.getdefaultencoding()=='ascii': + +if six.PY2 and sys.getdefaultencoding() == 'ascii': import imp + imp.reload(sys) sys.setdefaultencoding('utf-8') from django.apps import AppConfig + class SiteApp(AppConfig): name = "site" diff --git a/tests/xtests/site/models.py b/tests/xtests/site/models.py index 0bc63e7ee..f180f0248 100644 --- a/tests/xtests/site/models.py +++ b/tests/xtests/site/models.py @@ -2,4 +2,4 @@ class ModelA(models.Model): - name = models.CharField(max_length=64) \ No newline at end of file + name = models.CharField(max_length=64) diff --git a/tests/xtests/site/tests.py b/tests/xtests/site/tests.py index 808997f40..2b16ae837 100644 --- a/tests/xtests/site/tests.py +++ b/tests/xtests/site/tests.py @@ -8,7 +8,7 @@ from .models import ModelA -class ModelAAdmin(object): +class ModelAAdmin: pass @@ -23,7 +23,7 @@ def get(self, request): return HttpResponse(self.site_title) -class TestOption(object): +class TestOption: site_title = "TEST PROJECT" diff --git a/tests/xtests/view_base/adminx.py b/tests/xtests/view_base/adminx.py index b75fc8f8a..b82aa9f4e 100644 --- a/tests/xtests/view_base/adminx.py +++ b/tests/xtests/view_base/adminx.py @@ -1,26 +1,33 @@ from __future__ import absolute_import + from xadmin.sites import AdminSite from xadmin.views import BaseAdminView, CommAdminView, ListAdminView from .models import ModelA, ModelB site = AdminSite('views_base') -class ModelAAdmin(object): + +class ModelAAdmin: test_model_attr = 'test_model' model_icon = 'flag' + class TestBaseView(BaseAdminView): pass + class TestCommView(CommAdminView): global_models_icon = {ModelB: 'test'} + class TestAView(BaseAdminView): pass -class OptionA(object): + +class OptionA: option_attr = 'option_test' + site.register_modelview(r'^list$', ListAdminView, name='%s_%s_list') site.register_view(r"^test/base$", TestBaseView, 'test') diff --git a/tests/xtests/view_base/apps.py b/tests/xtests/view_base/apps.py index 5b59ac85d..9a7b4cd08 100644 --- a/tests/xtests/view_base/apps.py +++ b/tests/xtests/view_base/apps.py @@ -1,13 +1,17 @@ #!/usr/bin/env python -#coding:utf-8 +# coding:utf-8 import sys + from django.utils import six -if six.PY2 and sys.getdefaultencoding()=='ascii': + +if six.PY2 and sys.getdefaultencoding() == 'ascii': import imp + imp.reload(sys) sys.setdefaultencoding('utf-8') from django.apps import AppConfig + class ViewBaseApp(AppConfig): name = "view_base" diff --git a/tests/xtests/view_base/models.py b/tests/xtests/view_base/models.py index b1db56440..661335fa2 100644 --- a/tests/xtests/view_base/models.py +++ b/tests/xtests/view_base/models.py @@ -4,5 +4,6 @@ class ModelA(models.Model): name = models.CharField(max_length=64) + class ModelB(models.Model): - name = models.CharField(max_length=64) \ No newline at end of file + name = models.CharField(max_length=64) diff --git a/tests/xtests/view_base/tests.py b/tests/xtests/view_base/tests.py index a779341f4..a1a4e10de 100644 --- a/tests/xtests/view_base/tests.py +++ b/tests/xtests/view_base/tests.py @@ -1,12 +1,12 @@ from __future__ import absolute_import -from django.contrib.auth.models import User - from base import BaseTest -from xadmin.views import BaseAdminView, BaseAdminPlugin, ModelAdminView, ListAdminView +from django.contrib.auth.models import User -from .models import ModelA, ModelB +from xadmin.views import ListAdminView from .adminx import site, ModelAAdmin, TestBaseView, TestCommView, TestAView, OptionA +from .models import ModelA, ModelB + class BaseAdminTest(BaseTest): @@ -55,6 +55,6 @@ def setUp(self): self.test_view_class = site.get_view_class(TestCommView) self.test_view = self.test_view_class(self._mocked_request('test/comm')) - def test_model_icon(self): + def test_model_icon(self): self.assertEqual(self.test_view.get_model_icon(ModelA), 'flag') self.assertEqual(self.test_view.get_model_icon(ModelB), 'test') diff --git a/tests/xtests/view_base/urls.py b/tests/xtests/view_base/urls.py index a6a3601ec..fb6e14393 100644 --- a/tests/xtests/view_base/urls.py +++ b/tests/xtests/view_base/urls.py @@ -1,7 +1,9 @@ from __future__ import absolute_import -from django.conf.urls import patterns, include + +from django.urls import path + from .adminx import site -urlpatterns = patterns('', - (r'', include(site.urls)), -) \ No newline at end of file +urlpatterns = [ + path(r'', site.urls), +] diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..05cf3346a --- /dev/null +++ b/tox.ini @@ -0,0 +1,29 @@ +# https://tox.readthedocs.io/en/latest/ +# pip install tox (python3) +# cd django-xadmin +# tox -r (run CI tests) + +[tox] +minversion = 3.5.2 +# python and django supported +envlist = py3-django{20,21,lastest} + +# python with coverage +[testenv:py3-django20] +deps = + django20: Django>=2.0,<2.1 + coverage +# visit htmlcov/index.html in your browser +commands = + - coverage erase + coverage run tests/runtests.py + - coverage html + + +[testenv] +deps = + django21: Django>=2.1,<2.2 + djangolastest: Django +commands = + python tests/runtests.py + diff --git a/xadmin/__init__.py b/xadmin/__init__.py index 3e1a0522c..8984cfbb3 100644 --- a/xadmin/__init__.py +++ b/xadmin/__init__.py @@ -1,9 +1,10 @@ +default_app_config = 'xadmin.apps.XAdminConfig' VERSION = (0,6,0) from xadmin.sites import AdminSite, site -class Settings(object): +class Settings: pass @@ -50,9 +51,9 @@ def autodiscover(): for app_config in apps.get_app_configs(): mod = import_module(app_config.name) + before_import_registry = site.copy_registry() # Attempt to import the app's admin module. try: - before_import_registry = site.copy_registry() import_module('%s.adminx' % app_config.name) except: # Reset the model registry to the state before the last import as @@ -67,4 +68,3 @@ def autodiscover(): if module_has_submodule(mod, 'adminx'): raise -default_app_config = 'xadmin.apps.XAdminConfig' diff --git a/xadmin/adminx.py b/xadmin/adminx.py index e7a66e0ff..070851356 100644 --- a/xadmin/adminx.py +++ b/xadmin/adminx.py @@ -5,13 +5,13 @@ from django.utils.translation import ugettext_lazy as _, ugettext -class UserSettingsAdmin(object): +class UserSettingsAdmin: model_icon = 'fa fa-cog' hidden_menu = True xadmin.site.register(UserSettings, UserSettingsAdmin) -class LogAdmin(object): +class LogAdmin: def link(self, instance): if instance.content_type and instance.object_id and instance.action_flag != 'delete': diff --git a/xadmin/filters.py b/xadmin/filters.py index 9ab977a6c..9917235c4 100644 --- a/xadmin/filters.py +++ b/xadmin/filters.py @@ -23,7 +23,7 @@ reverse_field_path, get_limit_choices_to_from_path, prepare_lookup_value) -class BaseFilter(object): +class BaseFilter: title = None template = 'xadmin/filters/list.html' @@ -47,10 +47,8 @@ def query_string(self, new_params=None, remove=None): return self.admin_view.get_query_string(new_params, remove) def form_params(self): - arr = map(lambda k: FILTER_PREFIX + k, self.used_params.keys()) - if six.PY3: - arr = list(arr) - return self.admin_view.get_form_params(remove=arr) + prefixed_keys = [FILTER_PREFIX + key for key in self.used_params.keys()] + return self.admin_view.get_form_params(remove=prefixed_keys) def has_output(self): """ @@ -62,21 +60,25 @@ def has_output(self): def is_used(self): return len(self.used_params) > 0 - def do_filte(self, queryset): + def do_filter(self, queryset): """ Returns the filtered queryset. """ - raise NotImplementedError + return NotImplementedError def get_context(self): return {'title': self.title, 'spec': self, 'form_params': self.form_params()} + def get_media(self): + """Media this filter""" + raise NotImplementedError + def __str__(self): tpl = get_template(self.template) return mark_safe(tpl.render(context=self.get_context())) -class FieldFilterManager(object): +class FieldFilterManager: _field_list_filters = [] _take_priority_index = 0 @@ -123,27 +125,21 @@ def __init__(self, field, request, params, model, admin_view, field_path): self.context_params["%s_val" % name] = value else: self.context_params["%s_val" % name] = '' - - arr = map( - lambda kv: setattr(self, 'lookup_' + kv[0], kv[1]), - self.context_params.items() - ) - if six.PY3: - list(arr) + # set lookups + for kv in self.context_params.items(): + setattr(self, 'lookup_' + kv[0], kv[1]) def get_context(self): context = super(FieldFilter, self).get_context() context.update(self.context_params) - obj = map(lambda k: FILTER_PREFIX + k, self.used_params.keys()) - if six.PY3: - obj = list(obj) - context['remove_url'] = self.query_string({}, obj) + prefixed_keys = [FILTER_PREFIX + k for k in self.used_params.keys()] + context['remove_url'] = self.query_string({}, prefixed_keys) return context def has_output(self): return True - def do_filte(self, queryset): + def do_filter(self, queryset): return queryset.filter(**self.used_params) @@ -239,7 +235,7 @@ class NumberFieldListFilter(FieldFilter): def test(cls, field, request, params, model, admin_view, field_path): return isinstance(field, (models.DecimalField, models.FloatField, models.IntegerField)) - def do_filte(self, queryset): + def do_filter(self, queryset): params = self.used_params.copy() ne_key = '%s__ne' % self.field_path if ne_key in params: @@ -309,6 +305,13 @@ def __init__(self, field, request, params, model, admin_view, field_path): }), ) + def get_media(self): + return self.admin_view.vendor( + 'datepicker.css', + 'datepicker.js', + 'xadmin.widget.datetime.js' + ) + def get_context(self): context = super(DateFieldListFilter, self).get_context() context['choice_selected'] = bool(self.lookup_year_val) or bool(self.lookup_month_val) \ @@ -329,6 +332,10 @@ def choices(self): class RelatedFieldSearchFilter(FieldFilter): template = 'xadmin/filters/fk_search.html' + def get_media(self): + return self.admin_view.vendor('select.js', 'select.css', + 'xadmin.widget.select.js') + @classmethod def test(cls, field, request, params, model, admin_view, field_path): if not is_related_field2(field): @@ -401,7 +408,7 @@ def __init__(self, field, request, params, model, model_admin, field_path): super(RelatedFieldListFilter, self).__init__( field, request, params, model, model_admin, field_path) - if hasattr(field, 'verbose_name'): + if not field.auto_created and hasattr(field, 'verbose_name'): self.lookup_title = field.verbose_name else: self.lookup_title = other_model._meta.verbose_name diff --git a/xadmin/locale/pt_BR/LC_MESSAGES/django.mo b/xadmin/locale/pt_BR/LC_MESSAGES/django.mo index 0187836e1..4d850f794 100644 Binary files a/xadmin/locale/pt_BR/LC_MESSAGES/django.mo and b/xadmin/locale/pt_BR/LC_MESSAGES/django.mo differ diff --git a/xadmin/locale/pt_BR/LC_MESSAGES/django.po b/xadmin/locale/pt_BR/LC_MESSAGES/django.po index 31d6ed00c..bb930a59b 100644 --- a/xadmin/locale/pt_BR/LC_MESSAGES/django.po +++ b/xadmin/locale/pt_BR/LC_MESSAGES/django.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: xadmin-core\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-20 13:28+0800\n" +"POT-Creation-Date: 2020-01-28 14:16-0300\n" "PO-Revision-Date: 2013-11-20 10:21+0000\n" "Last-Translator: gladson \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" @@ -22,59 +22,60 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: adminx.py:19 +#: .\adminx.py:20 msgid "Admin Object" -msgstr "" +msgstr "Adminstrar objeto" -#: apps.py:11 +#: .\apps.py:11 msgid "Administration" -msgstr "" +msgstr "Administração" -#: filters.py:159 filters.py:191 filters.py:407 filters.py:493 filters.py:531 +#: .\filters.py:169 .\filters.py:207 .\filters.py:427 .\filters.py:513 +#: .\filters.py:551 msgid "All" msgstr "Tudo" -#: filters.py:160 plugins/export.py:165 +#: .\filters.py:170 .\plugins\export.py:187 msgid "Yes" msgstr "Sim" -#: filters.py:161 plugins/export.py:165 +#: .\filters.py:171 .\plugins\export.py:187 msgid "No" msgstr "Não" -#: filters.py:175 +#: .\filters.py:191 msgid "Unknown" msgstr "Desconhecido" -#: filters.py:267 +#: .\filters.py:287 msgid "Any date" msgstr "Qualquer data" -#: filters.py:268 +#: .\filters.py:288 msgid "Has date" msgstr "Tem data" -#: filters.py:271 +#: .\filters.py:291 msgid "Has no date" msgstr "Não tem data" -#: filters.py:274 widgets.py:30 +#: .\filters.py:294 .\widgets.py:35 .\widgets.py:82 msgid "Today" msgstr "Hoje" -#: filters.py:278 +#: .\filters.py:298 msgid "Past 7 days" msgstr "Passados 7 dias" -#: filters.py:282 +#: .\filters.py:302 msgid "This month" msgstr "Este mês" -#: filters.py:286 +#: .\filters.py:306 msgid "This year" msgstr "Este ano" -#: forms.py:10 +#: .\forms.py:10 msgid "" "Please enter the correct username and password for a staff account. Note " "that both fields are case-sensitive." @@ -82,178 +83,168 @@ msgstr "" "Por favor, insira o nome de usuário e a senha corretamente para sua conta " "pessoal. Perceba que ambos os campos são case-sensitive." -#: forms.py:21 +#: .\forms.py:21 msgid "Please log in again, because your session has expired." msgstr "Por favor faça login novamente, porque a sua sessão expirou." -#: forms.py:41 +#: .\forms.py:42 #, python-format msgid "Your e-mail address is not your username. Try '%s' instead." msgstr "" "O seu endereço de e-mail não é seu nome de usuário. Tente '% s' em seu lugar." -#: models.py:48 +#: .\models.py:46 msgid "Title" msgstr "Título" -#: models.py:49 models.py:88 models.py:107 models.py:149 +#: .\models.py:47 .\models.py:87 .\models.py:107 .\models.py:151 msgid "user" msgstr "Usuário" -#: models.py:50 +#: .\models.py:48 msgid "Url Name" msgstr "Nome da Url" -#: models.py:52 +#: .\models.py:50 msgid "Query String" msgstr "String de Consulta" -#: models.py:53 +#: .\models.py:51 msgid "Is Shared" msgstr "É Compartilhada" -#: models.py:66 plugins/bookmark.py:50 plugins/bookmark.py:180 +#: .\models.py:64 .\plugins\bookmark.py:59 .\plugins\bookmark.py:194 msgid "Bookmark" msgstr "Favorito" -#: models.py:67 +#: .\models.py:65 msgid "Bookmarks" msgstr "Favoritos" -#: models.py:89 +#: .\models.py:88 msgid "Settings Key" msgstr "Configuração da chave" -#: models.py:90 +#: .\models.py:89 msgid "Settings Content" msgstr "Configurações de conteúdo" -#: models.py:102 +#: .\models.py:101 msgid "User Setting" msgstr "Configuração de usuário" -#: models.py:103 +#: .\models.py:102 msgid "User Settings" msgstr "Configurações do Usuário" -#: models.py:108 +#: .\models.py:108 msgid "Page" msgstr "Página" -#: models.py:109 views/dashboard.py:82 views/dashboard.py:92 +#: .\models.py:109 .\views\dashboard.py:85 .\views\dashboard.py:95 msgid "Widget Type" msgstr "Tipo de Widget" -#: models.py:110 views/dashboard.py:83 +#: .\models.py:110 .\views\dashboard.py:86 msgid "Widget Params" msgstr "Parâmetros do Widget" -#: models.py:137 +#: .\models.py:137 msgid "User Widget" msgstr "Widget do Usuário" -#: models.py:138 +#: .\models.py:138 msgid "User Widgets" msgstr "Widgets do Usuário" -#: models.py:142 -#, fuzzy -#| msgid "Date/time" +#: .\models.py:144 msgid "action time" -msgstr "Data/Hora" +msgstr "Data da ação" -#: models.py:151 +#: .\models.py:153 msgid "action ip" -msgstr "" +msgstr "IP da ação" -#: models.py:155 +#: .\models.py:157 msgid "content type" -msgstr "" +msgstr "Tipo de conteúdo" -#: models.py:158 +#: .\models.py:160 msgid "object id" -msgstr "" +msgstr "ID do objeto" -#: models.py:159 +#: .\models.py:161 msgid "object repr" -msgstr "" +msgstr "Objeto" -#: models.py:160 +#: .\models.py:162 msgid "action flag" -msgstr "" +msgstr "Ação" -#: models.py:161 -#, fuzzy -#| msgid "Change %s" +#: .\models.py:163 msgid "change message" -msgstr "Alterar %s" +msgstr "Descrição" -#: models.py:164 -#, fuzzy -#| msgid "log in" +#: .\models.py:166 msgid "log entry" -msgstr "Entrar" +msgstr "Histório de dados" -#: models.py:165 +#: .\models.py:167 msgid "log entries" -msgstr "" +msgstr "Histórico de ações" -#: models.py:173 +#: .\models.py:175 #, python-format msgid "Added \"%(object)s\"." -msgstr "" +msgstr "Adicionado \"%(object)s\"." -#: models.py:175 -#, fuzzy, python-format -#| msgid "Change one %(objects_name)s" -#| msgid_plural "Batch change %(counter)s %(objects_name)s" +#: .\models.py:177 +#, python-format msgid "Changed \"%(object)s\" - %(changes)s" -msgstr "Alterar um %(objects_name)s" +msgstr "Alterado \"%(object)s\" - %(changes)s" -#: models.py:180 -#, fuzzy, python-format -#| msgid "Related Objects" +#: .\models.py:182 +#, python-format msgid "Deleted \"%(object)s.\"" -msgstr "Objetos Relacionados" +msgstr "Deletado \"%(object)s\"" -#: plugins/actions.py:57 +#: .\plugins\actions.py:58 #, python-format msgid "Delete selected %(verbose_name_plural)s" -msgstr "Excluir selecionado %(verbose_name_plural)s" +msgstr "Excluir %(verbose_name_plural)s selecionados" -#: plugins/actions.py:72 -#, fuzzy, python-format -#| msgid "Successfully deleted %(count)d %(items)s." +#: .\plugins\actions.py:73 +#, python-format msgid "Batch delete %(count)d %(items)s." -msgstr "Excluído com sucesso %(count)d %(items)s." +msgstr "Lote deletado %(count)d %(items)s." -#: plugins/actions.py:78 +#: .\plugins\actions.py:79 #, python-format msgid "Successfully deleted %(count)d %(items)s." msgstr "Excluído com sucesso %(count)d %(items)s." -#: plugins/actions.py:110 views/delete.py:70 +#: .\plugins\actions.py:111 .\views\delete.py:71 #, python-format msgid "Cannot delete %(name)s" msgstr "Não é possível excluir %(name)s" -#: plugins/actions.py:112 views/delete.py:73 +#: .\plugins\actions.py:113 .\views\delete.py:74 msgid "Are you sure?" msgstr "Você tem certeza?" -#: plugins/actions.py:158 +#: .\plugins\actions.py:159 #, python-format msgid "%(total_count)s selected" msgid_plural "All %(total_count)s selected" msgstr[0] "Todos %(total_count)s selecionados" msgstr[1] "Todos %(total_count)s selecionados" -#: plugins/actions.py:162 +#: .\plugins\actions.py:163 #, python-format msgid "0 of %(cnt)s selected" msgstr "0 de %(cnt)s selecionados" -#: plugins/actions.py:179 plugins/actions.py:189 +#: .\plugins\actions.py:180 .\plugins\actions.py:190 msgid "" "Items must be selected in order to perform actions on them. No items have " "been changed." @@ -261,331 +252,381 @@ msgstr "" "Os itens devem ser selecionados, a fim de executar ações sobre eles. Não há " "itens alterados." -#: plugins/aggregation.py:14 +#: .\plugins\aggregation.py:14 msgid "Min" msgstr "Min" -#: plugins/aggregation.py:14 +#: .\plugins\aggregation.py:14 msgid "Max" msgstr "Max" -#: plugins/aggregation.py:14 +#: .\plugins\aggregation.py:14 msgid "Avg" msgstr "Médio" -#: plugins/aggregation.py:14 +#: .\plugins\aggregation.py:14 msgid "Sum" msgstr "Soma" -#: plugins/aggregation.py:14 +#: .\plugins\aggregation.py:14 msgid "Count" msgstr "Contar" -#: plugins/auth.py:21 -#, fuzzy, python-format +#: .\plugins\auth.py:25 +#, python-format msgid "Can add %s" -msgstr "Pode ver %s" +msgstr "Pode adicionar %s" -#: plugins/auth.py:22 -#, fuzzy, python-format +#: .\plugins\auth.py:26 +#, python-format msgid "Can change %s" -msgstr "Alterar %s" +msgstr "Pode alterar %s" -#: plugins/auth.py:23 -#, fuzzy, python-format +#: .\plugins\auth.py:27 +#, python-format msgid "Can edit %s" -msgstr "Pode ver %s" +msgstr "Pode editar %s" -#: plugins/auth.py:24 -#, fuzzy, python-format +#: .\plugins\auth.py:28 +#, python-format msgid "Can delete %s" -msgstr "Não é possível excluir %(name)s" +msgstr "Pode deletar %s" -#: plugins/auth.py:25 +#: .\plugins\auth.py:29 #, python-format msgid "Can view %s" msgstr "Pode ver %s" -#: plugins/auth.py:87 +#: .\plugins\auth.py:91 msgid "Personal info" msgstr "Informações pessoais" -#: plugins/auth.py:91 +#: .\plugins\auth.py:95 msgid "Permissions" msgstr "Permissões" -#: plugins/auth.py:94 +#: .\plugins\auth.py:98 msgid "Important dates" msgstr "Datas importantes" -#: plugins/auth.py:99 +#: .\plugins\auth.py:103 msgid "Status" -msgstr "Status" +msgstr "Estado" -#: plugins/auth.py:111 -#, fuzzy +#: .\plugins\auth.py:115 msgid "Permission Name" -msgstr "Permissões" +msgstr "Nome da permissão" -#: plugins/auth.py:167 +#: .\plugins\auth.py:171 msgid "Change Password" msgstr "Alterar Senha" -#: plugins/auth.py:198 +#: .\plugins\auth.py:202 #, python-format msgid "Change password: %s" msgstr "Alterar senha: %s" -#: plugins/auth.py:223 plugins/auth.py:255 +#: .\plugins\auth.py:227 .\plugins\auth.py:259 msgid "Password changed successfully." msgstr "Senha alterada com sucesso." -#: plugins/auth.py:242 templates/xadmin/auth/user/change_password.html:11 -#: templates/xadmin/auth/user/change_password.html:22 -#: templates/xadmin/auth/user/change_password.html:55 +#: .\plugins\auth.py:246 .\templates\xadmin\auth\user\change_password.html:11 +#: .\templates\xadmin\auth\user\change_password.html:22 +#: .\templates\xadmin\auth\user\change_password.html:55 msgid "Change password" msgstr "Alterar a senha" -#: plugins/batch.py:44 +#: .\plugins\batch.py:44 msgid "Change this field" msgstr "Alterar este campo" -#: plugins/batch.py:65 +#: .\plugins\batch.py:65 #, python-format msgid "Batch Change selected %(verbose_name_plural)s" -msgstr "Alterar lote selecionado %(verbose_name_plural)s" +msgstr "Alterar %(verbose_name_plural)s selecionados em lote" -#: plugins/batch.py:89 +#: .\plugins\batch.py:89 #, python-format msgid "Successfully change %(count)d %(items)s." msgstr "Alterado com sucesso %(count)d %(items)s." -#: plugins/batch.py:138 +#: .\plugins\batch.py:138 #, python-format msgid "Batch change %s" msgstr "Lote alterado %s" -#: plugins/bookmark.py:173 +#: .\plugins\bookmark.py:187 msgid "bookmark" msgstr "Favorito" -#: plugins/bookmark.py:176 +#: .\plugins\bookmark.py:190 msgid "Bookmark Widget, can show user's bookmark list data in widget." msgstr "" "Widget de Marcador, pode mostrar a lista de marcadores do usuário no widget" -#: plugins/chart.py:25 +#: .\plugins\chart.py:24 msgid "Show models simple chart." msgstr "Mostrar modelos gráfico simples." -#: plugins/chart.py:51 +#: .\plugins\chart.py:50 #, python-format msgid "%s Charts" msgstr "%s Gráficos" -#: plugins/comments.py:33 +#: .\plugins\comments.py:33 msgid "Metadata" -msgstr "" +msgstr "Metadados" -#: plugins/comments.py:60 +#: .\plugins\comments.py:60 msgid "flagged" msgid_plural "flagged" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "Marcado" +msgstr[1] "Marcados" -#: plugins/comments.py:61 +#: .\plugins\comments.py:61 msgid "Flag selected comments" -msgstr "" +msgstr "Marcar comentários selecionados" -#: plugins/comments.py:66 +#: .\plugins\comments.py:66 msgid "approved" msgid_plural "approved" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "Aprovado" +msgstr[1] "Aprovados" -#: plugins/comments.py:67 +#: .\plugins\comments.py:67 msgid "Approve selected comments" -msgstr "" +msgstr "Aprovar comentários selecionados" -#: plugins/comments.py:72 -#, fuzzy +#: .\plugins\comments.py:72 msgid "removed" msgid_plural "removed" -msgstr[0] "Remover" -msgstr[1] "Remover" +msgstr[0] "removido" +msgstr[1] "removidos" -#: plugins/comments.py:73 -#, fuzzy +#: .\plugins\comments.py:73 msgid "Remove selected comments" -msgstr "Recuperar deletado %(name)s" +msgstr "Remover comentário selecionado" -#: plugins/comments.py:86 +#: .\plugins\comments.py:86 #, python-format msgid "1 comment was successfully %(action)s." msgid_plural "%(count)s comments were successfully %(action)s." -msgstr[0] "" -msgstr[1] "" +msgstr[0] "1 comentários foi %(action)s com sucesso." +msgstr[1] "%(count)s comentários foram %(action)s com sucesso" -#: plugins/details.py:52 views/list.py:578 +#: .\plugins\details.py:52 .\views\list.py:577 #, python-format msgid "Details of %s" msgstr "Detalhes de %s" -#: plugins/editable.py:46 +#: .\plugins\editable.py:46 #, python-format msgid "Enter %s" msgstr "Entrar %s" -#: plugins/editable.py:73 views/dashboard.py:649 views/delete.py:27 -#: views/detail.py:145 views/edit.py:454 +#: .\plugins\editable.py:73 .\views\dashboard.py:656 .\views\delete.py:28 +#: .\views\detail.py:145 .\views\edit.py:455 #, python-format msgid "%(name)s object with primary key %(key)r does not exist." msgstr "%(name)s objeto com chave primária %(key)r não existe." -#: plugins/export.py:98 plugins/export.py:135 +#: .\plugins\export.py:123 .\plugins\export.py:157 msgid "Sheet" msgstr "Planilha" -#: plugins/filters.py:133 plugins/quickfilter.py:141 +#: .\plugins\export.py:260 .\plugins\importexport.py:464 +msgid "Exported file delivery" +msgstr "Entrega de arquivo exportado" + +#: .\plugins\export.py:261 .\plugins\importexport.py:465 +msgid "Sent from address {0!s}. The file is attached." +msgstr "Enviado do endereço {0!s}. O arquivo encontra-se em anexo." + +#: .\plugins\export.py:307 .\plugins\importexport.py:504 +msgid "The file is sent to your email: " +msgstr "O arquivo será enviado para seu endereço de email: " + +#: .\plugins\export.py:310 .\plugins\importexport.py:507 +msgid "Your account does not have an email address." +msgstr "Sua conta não tem um endereço de email cadastrado." + +#: .\plugins\filters.py:141 .\plugins\quickfilter.py:142 #, python-format msgid "Filtering error: %s" msgstr "Filtrar erro: %s" -#: plugins/images.py:29 +#: .\plugins\images.py:29 msgid "Previous" msgstr "Anterior" -#: plugins/images.py:29 +#: .\plugins\images.py:29 msgid "Next" msgstr "Próximo" -#: plugins/images.py:29 +#: .\plugins\images.py:29 msgid "Slideshow" msgstr "Slideshow" -#: plugins/images.py:29 +#: .\plugins\images.py:29 msgid "Download" msgstr "Baixar" -#: plugins/images.py:50 +#: .\plugins\images.py:50 msgid "Change:" msgstr "Alterar:" -#: plugins/layout.py:16 +#: .\plugins\importexport.py:181 .\plugins\importexport.py:253 +#: .\templates\xadmin\blocks\model_list.top_toolbar.importexport.import.html:4 +#: .\templates\xadmin\import_export\import.html:6 +#: .\templates\xadmin\import_export\import.html:13 +msgid "Import" +msgstr "Importar" + +#: .\plugins\importexport.py:234 +#, python-format +msgid "

Imported file has a wrong encoding: %s

" +msgstr "

O arquivo importado tem uma codificação desconhecida: %s

" + +#: .\plugins\importexport.py:236 +msgid "

{0!s} encountered while trying to read file: {1:s}

" +msgstr "

{0!s} encontrado ao tentar ler o arquivo: {1:s}

" + +#: .\plugins\importexport.py:309 +msgid "Import finished" +msgstr "Importação terminada" + +#: .\plugins\importexport.py:309 +#: .\templates\xadmin\blocks\comm.top.topnav.html:23 +msgid "Add" +msgstr "Adicionar" + +#: .\plugins\importexport.py:310 +#: .\templates\xadmin\import_export\import.html:109 +msgid "Update" +msgstr "Atualizar" + +#: .\plugins\importexport.py:519 +msgid "You must select an export format." +msgstr "Precisa selecionar um formato de exportação." + +#: .\plugins\importexport.py:522 +msgid "You need to select items for export." +msgstr "Precisa selecionar itens para exportação." + +#: .\plugins\layout.py:16 msgid "Table" msgstr "Tabela" -#: plugins/layout.py:22 +#: .\plugins\layout.py:22 msgid "Thumbnails" msgstr "Miniaturas" -#: plugins/passwords.py:64 +#: .\plugins\passwords.py:62 msgid "Forgotten your password or username?" msgstr "Esqueceu seu nome de usuário ou senha?" -#: plugins/quickform.py:79 +#: .\plugins\quickform.py:114 #, python-format msgid "Create New %s" msgstr "Criar novo %s" -#: plugins/relate.py:104 +#: .\plugins\relate.py:105 msgid "Related Objects" msgstr "Objetos Relacionados" -#: plugins/relfield.py:29 plugins/topnav.py:38 +#: .\plugins\relfield.py:29 .\plugins\topnav.py:38 #, python-format msgid "Search %s" msgstr "Pesquisar %s" -#: plugins/relfield.py:67 -#, fuzzy, python-format -#| msgid "Select Date" +#: .\plugins\relfield.py:77 +#, python-format msgid "Select %s" -msgstr "Selecionar Data" +msgstr "Selecionar %s" -#: plugins/themes.py:47 +#: .\plugins\themes.py:59 msgid "Default" msgstr "Padrão" -#: plugins/themes.py:48 +#: .\plugins\themes.py:59 msgid "Default bootstrap theme" msgstr "Tema padrão bootstrap" -#: plugins/themes.py:49 +#: .\plugins\themes.py:60 msgid "Bootstrap2" msgstr "Bootstrap2" -#: plugins/themes.py:49 +#: .\plugins\themes.py:60 msgid "Bootstrap 2.x theme" msgstr "Tema Bootstrap 2.x" -#: plugins/topnav.py:62 views/dashboard.py:465 views/edit.py:387 -#: views/edit.py:396 +#: .\plugins\topnav.py:62 .\views\dashboard.py:468 .\views\edit.py:388 +#: .\views\edit.py:397 #, python-format msgid "Add %s" msgstr "Adicionar %s" -#: plugins/xversion.py:106 +#: .\plugins\xversion.py:107 msgid "Initial version." msgstr "Versão inicial." -#: plugins/xversion.py:108 +#: .\plugins\xversion.py:109 msgid "Change version." msgstr "Alterar versão." -#: plugins/xversion.py:110 +#: .\plugins\xversion.py:111 msgid "Revert version." msgstr "Reverter versão." -#: plugins/xversion.py:112 +#: .\plugins\xversion.py:113 msgid "Rercover version." msgstr "Recuperar versão." -#: plugins/xversion.py:114 +#: .\plugins\xversion.py:115 #, python-format msgid "Deleted %(verbose_name)s." msgstr "Excluídos %(verbose_name)s." -#: plugins/xversion.py:127 templates/xadmin/views/recover_form.html:26 +#: .\plugins\xversion.py:128 .\templates\xadmin\views\recover_form.html:26 msgid "Recover" msgstr "Recuperar" -#: plugins/xversion.py:143 templates/xadmin/views/model_history.html:11 -#: templates/xadmin/views/revision_diff.html:11 -#: templates/xadmin/views/revision_form.html:15 +#: .\plugins\xversion.py:144 .\templates\xadmin\views\model_history.html:11 +#: .\templates\xadmin\views\revision_diff.html:11 +#: .\templates\xadmin\views\revision_form.html:15 msgid "History" msgstr "Histórico" -#: plugins/xversion.py:194 templates/xadmin/views/recover_form.html:14 -#: templates/xadmin/views/recover_list.html:10 +#: .\plugins\xversion.py:195 .\templates\xadmin\views\recover_form.html:14 +#: .\templates\xadmin\views\recover_list.html:10 #, python-format msgid "Recover deleted %(name)s" msgstr "Recuperar deletado %(name)s" -#: plugins/xversion.py:238 +#: .\plugins\xversion.py:239 #, python-format msgid "Change history: %s" msgstr "Alterar histórico: %s" -#: plugins/xversion.py:288 +#: .\plugins\xversion.py:289 msgid "Must select two versions." msgstr "É necessário selecionar 2 versões" -#: plugins/xversion.py:296 +#: .\plugins\xversion.py:297 msgid "Please select two different versions." msgstr "Por favor selecione duas versões diferentes." -#: plugins/xversion.py:383 plugins/xversion.py:500 +#: .\plugins\xversion.py:384 .\plugins\xversion.py:501 #, python-format msgid "Current: %s" msgstr "Atual: %s" -#: plugins/xversion.py:424 +#: .\plugins\xversion.py:425 #, python-format msgid "Revert %s" msgstr "Revertido: %s" -#: plugins/xversion.py:440 +#: .\plugins\xversion.py:441 #, python-format msgid "" "The %(model)s \"%(name)s\" was reverted successfully. You may edit it again " @@ -594,12 +635,12 @@ msgstr "" "%(model)s \"%(name)s\" foi revertido(a) com sucesso. Você pode editá-lo(a) " "novamente abaixo." -#: plugins/xversion.py:461 +#: .\plugins\xversion.py:462 #, python-format msgid "Recover %s" msgstr "Recuperar %s" -#: plugins/xversion.py:477 +#: .\plugins\xversion.py:478 #, python-format msgid "" "The %(model)s \"%(name)s\" was recovered successfully. You may edit it again " @@ -608,45 +649,47 @@ msgstr "" "%(model)s \"%(name)s\" foi recuperado(a) com sucesso. Você pode editá-lo(a) " "novamente abaixo." -#: templates/xadmin/404.html:4 templates/xadmin/404.html:8 +#: .\templates\xadmin\404.html:4 .\templates\xadmin\404.html:8 msgid "Page not found" msgstr "Página não encontrada" -#: templates/xadmin/404.html:10 +#: .\templates\xadmin\404.html:10 msgid "We're sorry, but the requested page could not be found." msgstr "Pedimos desculpas, mas a página solicitada não foi encontrada." -#: templates/xadmin/500.html:7 -#: templates/xadmin/auth/user/change_password.html:10 -#: templates/xadmin/auth/user/change_password.html:15 -#: templates/xadmin/base_site.html:53 -#: templates/xadmin/includes/sitemenu_default.html:7 -#: templates/xadmin/views/app_index.html:9 -#: templates/xadmin/views/batch_change_form.html:9 -#: templates/xadmin/views/invalid_setup.html:7 -#: templates/xadmin/views/model_dashboard.html:7 -#: templates/xadmin/views/model_delete_selected_confirm.html:8 -#: templates/xadmin/views/model_history.html:8 -#: templates/xadmin/views/recover_form.html:8 -#: templates/xadmin/views/recover_list.html:8 -#: templates/xadmin/views/revision_diff.html:8 -#: templates/xadmin/views/revision_form.html:8 views/base.py:473 +#: .\templates\xadmin\500.html:7 +#: .\templates\xadmin\auth\user\change_password.html:10 +#: .\templates\xadmin\auth\user\change_password.html:15 +#: .\templates\xadmin\base_site.html:53 +#: .\templates\xadmin\import_export\export_action.html:13 +#: .\templates\xadmin\import_export\import.html:11 +#: .\templates\xadmin\includes\sitemenu_default.html:7 +#: .\templates\xadmin\views\app_index.html:9 +#: .\templates\xadmin\views\batch_change_form.html:9 +#: .\templates\xadmin\views\invalid_setup.html:7 +#: .\templates\xadmin\views\model_dashboard.html:7 +#: .\templates\xadmin\views\model_delete_selected_confirm.html:8 +#: .\templates\xadmin\views\model_history.html:8 +#: .\templates\xadmin\views\recover_form.html:8 +#: .\templates\xadmin\views\recover_list.html:8 +#: .\templates\xadmin\views\revision_diff.html:8 +#: .\templates\xadmin\views\revision_form.html:8 .\views\base.py:494 msgid "Home" msgstr "Início" -#: templates/xadmin/500.html:8 +#: .\templates\xadmin\500.html:8 msgid "Server error" msgstr "Erro do servidor" -#: templates/xadmin/500.html:12 +#: .\templates\xadmin\500.html:12 msgid "Server error (500)" msgstr "Erro do servidor (500)" -#: templates/xadmin/500.html:15 +#: .\templates\xadmin\500.html:15 msgid "Server Error (500)" msgstr "Erro do Servidor (500)" -#: templates/xadmin/500.html:16 +#: .\templates\xadmin\500.html:16 msgid "" "There's been an error. It's been reported to the site administrators via e-" "mail and should be fixed shortly. Thanks for your patience." @@ -654,24 +697,24 @@ msgstr "" "Ocorreu um erro. E foi relatado aos administradores do site via e-mail e " "deve ser corrigido em breve. Obrigado por sua paciência." -#: templates/xadmin/auth/password_reset/complete.html:11 -#: templates/xadmin/auth/password_reset/done.html:11 +#: .\templates\xadmin\auth\password_reset\complete.html:11 +#: .\templates\xadmin\auth\password_reset\done.html:11 msgid "Password reset successful" msgstr "Redefinição de senha completada." -#: templates/xadmin/auth/password_reset/complete.html:14 +#: .\templates\xadmin\auth\password_reset\complete.html:14 msgid "Your password has been set. You may go ahead and log in now." msgstr "Sua senha foi definida. Você pode seguir e entrar agora." -#: templates/xadmin/auth/password_reset/complete.html:15 +#: .\templates\xadmin\auth\password_reset\complete.html:15 msgid "Log in" msgstr "Entrar" -#: templates/xadmin/auth/password_reset/confirm.html:12 +#: .\templates\xadmin\auth\password_reset\confirm.html:12 msgid "Enter new password" msgstr "Digite a nova senha" -#: templates/xadmin/auth/password_reset/confirm.html:17 +#: .\templates\xadmin\auth\password_reset\confirm.html:17 msgid "" "Please enter your new password twice so we can verify you typed it in " "correctly." @@ -679,15 +722,15 @@ msgstr "" "Por favor forneça sua nova senha 2 vezes para que possamos verificar se a " "mesma foi digitada corretamente." -#: templates/xadmin/auth/password_reset/confirm.html:19 +#: .\templates\xadmin\auth\password_reset\confirm.html:19 msgid "Change my password" msgstr "Alterar minha senha" -#: templates/xadmin/auth/password_reset/confirm.html:24 +#: .\templates\xadmin\auth\password_reset\confirm.html:24 msgid "Password reset unsuccessful" msgstr "A senha foi redefinida com sucesso" -#: templates/xadmin/auth/password_reset/confirm.html:27 +#: .\templates\xadmin\auth\password_reset\confirm.html:27 msgid "" "The password reset link was invalid, possibly because it has already been " "used. Please request a new password reset." @@ -695,7 +738,7 @@ msgstr "" "O link de redefinição de senha era inválida, possivelmente porque ele já foi " "usado. Por favor, solicite uma nova redefinição de senha." -#: templates/xadmin/auth/password_reset/done.html:14 +#: .\templates\xadmin\auth\password_reset\done.html:14 msgid "" "We've e-mailed you instructions for setting your password to the e-mail " "address you submitted. You should be receiving it shortly." @@ -703,7 +746,7 @@ msgstr "" "Nós enviamos um e-mail com instruções para configurar sua senha para o " "endereço de e-mail que você solicitou. Você deve recebê-lo em breve." -#: templates/xadmin/auth/password_reset/email.html:2 +#: .\templates\xadmin\auth\password_reset\email.html:2 #, python-format msgid "" "You're receiving this e-mail because you requested a password reset for your " @@ -712,28 +755,28 @@ msgstr "" "Você está recebendo este e-mail porque você pediu uma redefinição de senha " "para sua conta de usuário em %(site_name)s." -#: templates/xadmin/auth/password_reset/email.html:4 +#: .\templates\xadmin\auth\password_reset\email.html:4 msgid "Please go to the following page and choose a new password:" msgstr "Por favor, vá para a página seguinte e escolha uma nova senha:" -#: templates/xadmin/auth/password_reset/email.html:8 +#: .\templates\xadmin\auth\password_reset\email.html:8 msgid "Your username, in case you've forgotten:" msgstr "Seu nome de usuário, para o caso de ter esquecido:" -#: templates/xadmin/auth/password_reset/email.html:10 +#: .\templates\xadmin\auth\password_reset\email.html:10 msgid "Thanks for using our site!" msgstr "Obrigado por utilizar o nosso site!" -#: templates/xadmin/auth/password_reset/email.html:12 +#: .\templates\xadmin\auth\password_reset\email.html:12 #, python-format msgid "The %(site_name)s team" msgstr "A equipe %(site_name)s" -#: templates/xadmin/auth/password_reset/form.html:13 +#: .\templates\xadmin\auth\password_reset\form.html:13 msgid "Password reset" msgstr "Redefinição de senha" -#: templates/xadmin/auth/password_reset/form.html:17 +#: .\templates\xadmin\auth\password_reset\form.html:17 msgid "" "Forgotten your password? Enter your e-mail address below, and we'll e-mail " "instructions for setting a new one." @@ -741,15 +784,15 @@ msgstr "" "Esqueceu sua senha? Forneça seu endereço de e-mail abaixo, e nós lhe " "enviaremos instruções para definir uma nova." -#: templates/xadmin/auth/password_reset/form.html:25 +#: .\templates\xadmin\auth\password_reset\form.html:25 msgid "E-mail address:" msgstr "Endereço de e-mail:" -#: templates/xadmin/auth/password_reset/form.html:33 +#: .\templates\xadmin\auth\password_reset\form.html:33 msgid "Reset my password" msgstr "Redefinir minha senha" -#: templates/xadmin/auth/user/add_form.html:6 +#: .\templates\xadmin\auth\user\add_form.html:6 msgid "" "First, enter a username and password. Then, you'll be able to edit more user " "options." @@ -757,341 +800,410 @@ msgstr "" "Primeiro, insira um nome de usuário e senha. Então, você vai ser capaz de " "editar mais opções do usuário." -#: templates/xadmin/auth/user/add_form.html:8 +#: .\templates\xadmin\auth\user\add_form.html:8 msgid "Enter a username and password." msgstr "Forneça um nome de usuário e uma senha." -#: templates/xadmin/auth/user/change_password.html:31 -#: templates/xadmin/views/batch_change_form.html:24 -#: templates/xadmin/views/form.html:18 -#: templates/xadmin/views/model_form.html:20 +#: .\templates\xadmin\auth\user\change_password.html:31 +#: .\templates\xadmin\views\batch_change_form.html:24 +#: .\templates\xadmin\views\form.html:18 +#: .\templates\xadmin\views\model_form.html:20 msgid "Please correct the error below." msgid_plural "Please correct the errors below." msgstr[0] "Por favor corrija o erro abaixo." msgstr[1] "Por favor corrija os erros abaixo." -#: templates/xadmin/auth/user/change_password.html:38 +#: .\templates\xadmin\auth\user\change_password.html:38 msgid "Enter your new password." msgstr "Digite sua nova senha." -#: templates/xadmin/auth/user/change_password.html:40 +#: .\templates\xadmin\auth\user\change_password.html:40 #, python-format msgid "Enter a new password for the user %(username)s." msgstr "Digite uma nova senha para o usuário %(username)s." -#: templates/xadmin/base_site.html:18 +#: .\templates\xadmin\base_site.html:18 msgid "Welcome," msgstr "Bem-Vindo," -#: templates/xadmin/base_site.html:24 +#: .\templates\xadmin\base_site.html:24 msgid "Log out" msgstr "Sair" -#: templates/xadmin/base_site.html:36 +#: .\templates\xadmin\base_site.html:36 msgid "You don't have permission to edit anything." msgstr "Você não tem permissão para editar nada." -#: templates/xadmin/blocks/comm.top.theme.html:4 +#: .\templates\xadmin\blocks\comm.top.theme.html:4 msgid "Themes" msgstr "Temas" -#: templates/xadmin/blocks/comm.top.topnav.html:9 -#: templates/xadmin/blocks/model_list.nav_form.search_form.html:8 -#: templates/xadmin/filters/char.html:7 -#: templates/xadmin/filters/fk_search.html:7 -#: templates/xadmin/filters/fk_search.html:16 -#: templates/xadmin/filters/number.html:7 +#: .\templates\xadmin\blocks\comm.top.topnav.html:9 +#: .\templates\xadmin\blocks\model_list.nav_form.search_form.html:8 +#: .\templates\xadmin\filters\char.html:7 +#: .\templates\xadmin\filters\fk_search.html:7 +#: .\templates\xadmin\filters\fk_search.html:16 +#: .\templates\xadmin\filters\number.html:7 msgid "Search" msgstr "Pesquisar" -#: templates/xadmin/blocks/comm.top.topnav.html:23 -msgid "Add" -msgstr "Adicionar" - -#: templates/xadmin/blocks/model_form.submit_line.wizard.html:9 -#: templates/xadmin/blocks/model_form.submit_line.wizard.html:26 +#: .\templates\xadmin\blocks\model_form.submit_line.wizard.html:9 +#: .\templates\xadmin\blocks\model_form.submit_line.wizard.html:26 msgid "Prev step" msgstr "Passo anterior" -#: templates/xadmin/blocks/model_form.submit_line.wizard.html:13 -#: templates/xadmin/blocks/model_form.submit_line.wizard.html:29 +#: .\templates\xadmin\blocks\model_form.submit_line.wizard.html:13 +#: .\templates\xadmin\blocks\model_form.submit_line.wizard.html:29 msgid "Next step" msgstr "Próximo passo" -#: templates/xadmin/blocks/model_form.submit_line.wizard.html:15 -#: templates/xadmin/blocks/model_form.submit_line.wizard.html:31 -#: templates/xadmin/includes/submit_line.html:10 -#: templates/xadmin/includes/submit_line.html:13 -#: templates/xadmin/views/form.html:30 templates/xadmin/views/form.html:31 +#: .\templates\xadmin\blocks\model_form.submit_line.wizard.html:15 +#: .\templates\xadmin\blocks\model_form.submit_line.wizard.html:31 +#: .\templates\xadmin\includes\submit_line.html:10 +#: .\templates\xadmin\includes\submit_line.html:13 +#: .\templates\xadmin\views\form.html:30 .\templates\xadmin\views\form.html:31 msgid "Save" msgstr "Gravar" -#: templates/xadmin/blocks/model_list.nav_menu.bookmarks.html:7 +#: .\templates\xadmin\blocks\model_list.nav_menu.bookmarks.html:7 msgid "Clean Bookmarks" msgstr "Limpar Favoritos" -#: templates/xadmin/blocks/model_list.nav_menu.bookmarks.html:18 +#: .\templates\xadmin\blocks\model_list.nav_menu.bookmarks.html:18 msgid "No Bookmarks" msgstr "Sem Favoritos" -#: templates/xadmin/blocks/model_list.nav_menu.bookmarks.html:22 +#: .\templates\xadmin\blocks\model_list.nav_menu.bookmarks.html:22 msgid "New Bookmark" msgstr "Novo Favorito" -#: templates/xadmin/blocks/model_list.nav_menu.bookmarks.html:26 +#: .\templates\xadmin\blocks\model_list.nav_menu.bookmarks.html:26 msgid "Save current page as Bookmark" msgstr "Marcar a página atual como favorito" -#: templates/xadmin/blocks/model_list.nav_menu.bookmarks.html:32 +#: .\templates\xadmin\blocks\model_list.nav_menu.bookmarks.html:32 msgid "Enter bookmark title" msgstr "Digite o título do favorito" -#: templates/xadmin/blocks/model_list.nav_menu.bookmarks.html:33 +#: .\templates\xadmin\blocks\model_list.nav_menu.bookmarks.html:33 msgid "Waiting" msgstr "Aguardando" -#: templates/xadmin/blocks/model_list.nav_menu.bookmarks.html:33 +#: .\templates\xadmin\blocks\model_list.nav_menu.bookmarks.html:33 msgid "Save Bookmark" msgstr "Marcar Favorito" -#: templates/xadmin/blocks/model_list.nav_menu.filters.html:4 +#: .\templates\xadmin\blocks\model_list.nav_menu.filters.html:4 msgid "Filters" msgstr "Filtros" -#: templates/xadmin/blocks/model_list.nav_menu.filters.html:8 +#: .\templates\xadmin\blocks\model_list.nav_menu.filters.html:8 msgid "Clean Filters" msgstr "Limpar Filtros" -#: templates/xadmin/blocks/model_list.results_bottom.actions.html:19 +#: .\templates\xadmin\blocks\model_list.results_bottom.actions.html:19 msgid "Click here to select the objects across all pages" msgstr "Clique aqui para selecionar os objetos através de todas as páginas" -#: templates/xadmin/blocks/model_list.results_bottom.actions.html:19 +#: .\templates\xadmin\blocks\model_list.results_bottom.actions.html:19 #, python-format msgid "Select all %(total_count)s %(model_name)s" msgstr "Selecionar todos %(total_count)s %(model_name)s" -#: templates/xadmin/blocks/model_list.results_bottom.actions.html:20 +#: .\templates\xadmin\blocks\model_list.results_bottom.actions.html:20 msgid "Clear selection" msgstr "Limpar Seleção" -#: templates/xadmin/blocks/model_list.results_top.charts.html:4 +#: .\templates\xadmin\blocks\model_list.results_top.charts.html:4 msgid "Charts" msgstr "Gráficos" -#: templates/xadmin/blocks/model_list.top_toolbar.exports.html:4 -#: templates/xadmin/blocks/model_list.top_toolbar.exports.html:8 -#: templates/xadmin/blocks/model_list.top_toolbar.exports.html:19 -#: templates/xadmin/blocks/model_list.top_toolbar.exports.html:47 +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:4 +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:8 +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:19 +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:58 +#: .\templates\xadmin\blocks\model_list.top_toolbar.importexport.export.html:4 +#: .\templates\xadmin\blocks\model_list.top_toolbar.importexport.export.html:11 +#: .\templates\xadmin\blocks\model_list.top_toolbar.importexport.export.html:94 +#: .\templates\xadmin\import_export\export_action.html:7 +#: .\templates\xadmin\import_export\export_action.html:15 msgid "Export" msgstr "Exportar" -#: templates/xadmin/blocks/model_list.top_toolbar.exports.html:26 -#: templates/xadmin/blocks/model_list.top_toolbar.exports.html:29 -#: templates/xadmin/blocks/model_list.top_toolbar.exports.html:32 +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:28 +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:31 +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:34 msgid "Export with table header." msgstr "Exportar com cabeçalho da tabela" -#: templates/xadmin/blocks/model_list.top_toolbar.exports.html:35 -#: templates/xadmin/blocks/model_list.top_toolbar.exports.html:38 +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:37 +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:40 msgid "Export with format." msgstr "Exportar com o formato." -#: templates/xadmin/blocks/model_list.top_toolbar.exports.html:42 +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:45 msgid "Export all data." msgstr "Exportar todos os dados." -#: templates/xadmin/blocks/model_list.top_toolbar.exports.html:46 -#: templates/xadmin/widgets/base.html:41 +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:50 +#: .\templates\xadmin\blocks\model_list.top_toolbar.importexport.export.html:84 +msgid "Send result file via email." +msgstr "Enviar arquivo de resultado por email." + +#: .\templates\xadmin\blocks\model_list.top_toolbar.exports.html:57 +#: .\templates\xadmin\blocks\model_list.top_toolbar.importexport.export.html:92 +#: .\templates\xadmin\widgets\base.html:41 msgid "Close" msgstr "Fechar" -#: templates/xadmin/blocks/model_list.top_toolbar.layouts.html:4 +#: .\templates\xadmin\blocks\model_list.top_toolbar.importexport.export.html:34 +msgid "Export all data" +msgstr "Exportar todos os dados." + +#: .\templates\xadmin\blocks\model_list.top_toolbar.importexport.export.html:40 +msgid "with filter" +msgstr "com filtro" + +#: .\templates\xadmin\blocks\model_list.top_toolbar.importexport.export.html:51 +msgid "Export current page data." +msgstr "Exportar dados da página atual." + +#: .\templates\xadmin\blocks\model_list.top_toolbar.importexport.export.html:62 +msgid "Export selected data." +msgstr "Exportar dados selecionados." + +#: .\templates\xadmin\blocks\model_list.top_toolbar.importexport.export.html:73 +msgid "Export header only." +msgstr "Exportar somente cabeçalhos da tabela." + +#: .\templates\xadmin\blocks\model_list.top_toolbar.layouts.html:4 msgid "Layout" msgstr "Layout" -#: templates/xadmin/blocks/model_list.top_toolbar.refresh.html:8 +#: .\templates\xadmin\blocks\model_list.top_toolbar.refresh.html:8 msgid "Clean Refresh" msgstr "Atualização Limpa" -#: templates/xadmin/blocks/model_list.top_toolbar.refresh.html:14 +#: .\templates\xadmin\blocks\model_list.top_toolbar.refresh.html:14 #, python-format msgid "Every %(t)s seconds" msgstr "A cada %(t)s segundos" -#: templates/xadmin/blocks/model_list.top_toolbar.saveorder.html:4 +#: .\templates\xadmin\blocks\model_list.top_toolbar.saveorder.html:4 msgid "Save Order" -msgstr "" +msgstr "Salvar ordenação" -#: templates/xadmin/edit_inline/blank.html:5 views/detail.py:23 -#: views/edit.py:102 views/list.py:29 +#: .\templates\xadmin\edit_inline\blank.html:5 .\views\detail.py:25 +#: .\views\edit.py:104 .\views\list.py:31 msgid "Null" msgstr "Nulo" -#: templates/xadmin/filters/char.html:13 +#: .\templates\xadmin\filters\char.html:13 msgid "Enter" msgstr "Entrar" -#: templates/xadmin/filters/date.html:10 templates/xadmin/filters/date.html:13 +#: .\templates\xadmin\filters\date.html:10 +#: .\templates\xadmin\filters\date.html:13 msgid "Choice Date" msgstr "Data Escolhida" -#: templates/xadmin/filters/date.html:18 +#: .\templates\xadmin\filters\date.html:18 msgid "YY" msgstr "YY" -#: templates/xadmin/filters/date.html:19 +#: .\templates\xadmin\filters\date.html:19 msgid "year" msgstr "ano" -#: templates/xadmin/filters/date.html:22 +#: .\templates\xadmin\filters\date.html:22 msgid "MM" msgstr "MM" -#: templates/xadmin/filters/date.html:23 +#: .\templates\xadmin\filters\date.html:23 msgid "month" msgstr "mês" -#: templates/xadmin/filters/date.html:26 +#: .\templates\xadmin\filters\date.html:26 msgid "DD" msgstr "DD" -#: templates/xadmin/filters/date.html:27 +#: .\templates\xadmin\filters\date.html:27 msgid "day" msgstr "dia" -#: templates/xadmin/filters/date.html:29 templates/xadmin/filters/date.html:46 -#: templates/xadmin/filters/date.html:54 -#: templates/xadmin/filters/fk_search.html:24 -#: templates/xadmin/filters/number.html:37 +#: .\templates\xadmin\filters\date.html:29 +#: .\templates\xadmin\filters\date.html:46 +#: .\templates\xadmin\filters\date.html:54 +#: .\templates\xadmin\filters\fk_search.html:24 +#: .\templates\xadmin\filters\number.html:37 msgid "Apply" msgstr "Aplicar" -#: templates/xadmin/filters/date.html:34 +#: .\templates\xadmin\filters\date.html:34 msgid "Date Range" msgstr "Intervalo de Datas" -#: templates/xadmin/filters/date.html:41 +#: .\templates\xadmin\filters\date.html:41 msgid "Select Date" msgstr "Selecionar Data" -#: templates/xadmin/filters/date.html:42 +#: .\templates\xadmin\filters\date.html:42 msgid "From" msgstr "De" -#: templates/xadmin/filters/date.html:44 +#: .\templates\xadmin\filters\date.html:44 msgid "To" msgstr "Para" -#: templates/xadmin/filters/fk_search.html:14 -#, fuzzy -#| msgid "Select Date" +#: .\templates\xadmin\filters\fk_search.html:14 msgid "Select" -msgstr "Selecionar Data" +msgstr "Selecione" -#: templates/xadmin/filters/fk_search.html:26 -#: templates/xadmin/filters/number.html:39 +#: .\templates\xadmin\filters\fk_search.html:26 +#: .\templates\xadmin\filters\number.html:39 msgid "Clean" msgstr "Limpar" -#: templates/xadmin/filters/number.html:17 -#: templates/xadmin/filters/number.html:25 -#: templates/xadmin/filters/number.html:33 +#: .\templates\xadmin\filters\number.html:17 +#: .\templates\xadmin\filters\number.html:25 +#: .\templates\xadmin\filters\number.html:33 msgid "Enter Number" msgstr "Digite o Número" -#: templates/xadmin/filters/rel.html:3 +#: .\templates\xadmin\filters\rel.html:3 #, python-format msgid " By %(filter_title)s " msgstr " Por %(filter_title)s " -#: templates/xadmin/forms/transfer.html:4 +#: .\templates\xadmin\forms\transfer.html:4 msgid "Available" msgstr "Disponível" -#: templates/xadmin/forms/transfer.html:12 +#: .\templates\xadmin\forms\transfer.html:12 msgid "Click to choose all at once." msgstr "Clique para selecionar tudo de uma só vez." -#: templates/xadmin/forms/transfer.html:12 +#: .\templates\xadmin\forms\transfer.html:12 msgid "Choose all" msgstr "Escolher tudo" -#: templates/xadmin/forms/transfer.html:16 +#: .\templates\xadmin\forms\transfer.html:16 msgid "Choose" msgstr "Escolher" -#: templates/xadmin/forms/transfer.html:19 -#: templates/xadmin/widgets/base.html:40 +#: .\templates\xadmin\forms\transfer.html:19 +#: .\templates\xadmin\widgets\base.html:40 msgid "Remove" msgstr "Remover" -#: templates/xadmin/forms/transfer.html:23 +#: .\templates\xadmin\forms\transfer.html:23 msgid "Chosen" msgstr "Escolhido" -#: templates/xadmin/forms/transfer.html:27 +#: .\templates\xadmin\forms\transfer.html:27 msgid "Click to remove all chosen at once." msgstr "Clique para remover todos os escolhidos de uma vez." -#: templates/xadmin/forms/transfer.html:27 +#: .\templates\xadmin\forms\transfer.html:27 msgid "Remove all" msgstr "Remover tudo" -#: templates/xadmin/includes/pagination.html:9 +#: .\templates\xadmin\import_export\export_action.html:43 +#: .\templates\xadmin\import_export\import.html:59 +msgid "Submit" +msgstr "Enviar" + +#: .\templates\xadmin\import_export\import.html:26 +msgid "" +"Below is a preview of data to be imported. If you are satisfied with the " +"results, click 'Confirm import'" +msgstr "" +"Abaixo tem uma prévia dos dados que serão importados. Se você estiver " +"satisfeito com os resultados, pressione 'Confirmar importação'" + +#: .\templates\xadmin\import_export\import.html:29 +msgid "Confirm import" +msgstr "Confirmar importação" + +#: .\templates\xadmin\import_export\import.html:38 +msgid "This importer will import the following fields: " +msgstr "A importação de dados incluirá os seguintes campos: " + +#: .\templates\xadmin\import_export\import.html:67 +msgid "Errors" +msgstr "Erros" + +#: .\templates\xadmin\import_export\import.html:78 +msgid "Line number" +msgstr "Número da linha" + +#: .\templates\xadmin\import_export\import.html:88 +msgid "Preview" +msgstr "Anterior" + +#: .\templates\xadmin\import_export\import.html:103 +msgid "New" +msgstr "Novo" + +#: .\templates\xadmin\import_export\import.html:105 +msgid "Skipped" +msgstr "Pular" + +#: .\templates\xadmin\import_export\import.html:107 +#: .\templates\xadmin\includes\submit_line.html:24 +#: .\templates\xadmin\views\model_detail.html:28 .\views\delete.py:94 +msgid "Delete" +msgstr "Excluir" + +#: .\templates\xadmin\includes\pagination.html:9 msgid "Show all" msgstr "Mostrar Tudo" -#: templates/xadmin/includes/submit_line.html:10 -#: templates/xadmin/includes/submit_line.html:13 -#: templates/xadmin/views/form.html:30 templates/xadmin/views/form.html:31 +#: .\templates\xadmin\includes\submit_line.html:10 +#: .\templates\xadmin\includes\submit_line.html:13 +#: .\templates\xadmin\views\form.html:30 .\templates\xadmin\views\form.html:31 msgid "Saving.." msgstr "Salvando..." -#: templates/xadmin/includes/submit_line.html:17 +#: .\templates\xadmin\includes\submit_line.html:17 msgid "Save as new" msgstr "Gravar como novo" -#: templates/xadmin/includes/submit_line.html:18 +#: .\templates\xadmin\includes\submit_line.html:18 msgid "Save and add another" msgstr "Gravar e adicionar outro" -#: templates/xadmin/includes/submit_line.html:19 +#: .\templates\xadmin\includes\submit_line.html:19 msgid "Save and continue editing" msgstr "Gravar e continuar editando" -#: templates/xadmin/includes/submit_line.html:24 -#: templates/xadmin/views/model_detail.html:28 views/delete.py:93 -msgid "Delete" -msgstr "Excluir" - -#: templates/xadmin/views/app_index.html:13 +#: .\templates\xadmin\views\app_index.html:13 #, python-format msgid "%(name)s" msgstr "%(name)s" -#: templates/xadmin/views/batch_change_form.html:11 +#: .\templates\xadmin\views\batch_change_form.html:11 msgid "Change multiple objects" msgstr "Alterar múltiplos objetos" -#: templates/xadmin/views/batch_change_form.html:16 +#: .\templates\xadmin\views\batch_change_form.html:16 #, python-format msgid "Change one %(objects_name)s" msgid_plural "Batch change %(counter)s %(objects_name)s" msgstr[0] "Alterar um %(objects_name)s" -msgstr[1] "Alterar lote %(counter)s %(objects_name)s" +msgstr[1] "Alterar campos para %(counter)s %(objects_name)s selecionados" -#: templates/xadmin/views/batch_change_form.html:38 +#: .\templates\xadmin\views\batch_change_form.html:38 msgid "Change Multiple" msgstr "Alterar Múltiplos" -#: templates/xadmin/views/dashboard.html:15 -#: templates/xadmin/views/dashboard.html:22 -#: templates/xadmin/views/dashboard.html:23 +#: .\templates\xadmin\views\dashboard.html:15 +#: .\templates\xadmin\views\dashboard.html:22 +#: .\templates\xadmin\views\dashboard.html:23 msgid "Add Widget" msgstr "Adicionar Widget" -#: templates/xadmin/views/invalid_setup.html:13 +#: .\templates\xadmin\views\invalid_setup.html:13 msgid "" "Something's wrong with your database installation. Make sure the appropriate " "database tables have been created, and make sure the database is readable by " @@ -1101,44 +1213,44 @@ msgstr "" "tabelas foram criadas apropriadamente, e certifique-se que o banco de dados " "pode ser lido pelo usuário apropriado." -#: templates/xadmin/views/logged_out.html:16 +#: .\templates\xadmin\views\logged_out.html:16 msgid "Logout Success" msgstr "Saída com Sucesso" -#: templates/xadmin/views/logged_out.html:17 +#: .\templates\xadmin\views\logged_out.html:17 msgid "Thanks for spending some quality time with the Web site today." msgstr "Obrigado por gastar algum tempo de qualidade com o site hoje." -#: templates/xadmin/views/logged_out.html:19 +#: .\templates\xadmin\views\logged_out.html:19 msgid "Close Window" msgstr "Fechar Janela" -#: templates/xadmin/views/logged_out.html:20 +#: .\templates\xadmin\views\logged_out.html:20 msgid "Log in again" msgstr "Entrar novamente" -#: templates/xadmin/views/login.html:39 views/website.py:38 +#: .\templates\xadmin\views\login.html:39 .\views\website.py:39 msgid "Please Login" msgstr "Por Favor Autentique-se" -#: templates/xadmin/views/login.html:52 +#: .\templates\xadmin\views\login.html:52 msgid "Username" msgstr "Nome de Usuário" -#: templates/xadmin/views/login.html:64 +#: .\templates\xadmin\views\login.html:64 msgid "Password" msgstr "Senha" -#: templates/xadmin/views/login.html:75 +#: .\templates\xadmin\views\login.html:75 msgid "log in" msgstr "Entrar" -#: templates/xadmin/views/model_dashboard.html:26 -#: templates/xadmin/views/model_detail.html:25 +#: .\templates\xadmin\views\model_dashboard.html:26 +#: .\templates\xadmin\views\model_detail.html:25 msgid "Edit" msgstr "Editar" -#: templates/xadmin/views/model_delete_confirm.html:11 +#: .\templates\xadmin\views\model_delete_confirm.html:11 #, python-format msgid "" "Deleting the %(verbose_name)s '%(escaped_object)s' would result in deleting " @@ -1149,7 +1261,7 @@ msgstr "" "objetos relacionados, mas a sua conta não tem permissão para excluir os " "seguintes tipos de objetos:" -#: templates/xadmin/views/model_delete_confirm.html:19 +#: .\templates\xadmin\views\model_delete_confirm.html:19 #, python-format msgid "" "Deleting the %(verbose_name)s '%(escaped_object)s' would require deleting " @@ -1158,30 +1270,30 @@ msgstr "" "Excluir o %(verbose_name)s '%(escaped_object)s' exigiria exclusão dos " "seguintes objetos protegidos relacionados:" -#: templates/xadmin/views/model_delete_confirm.html:27 +#: .\templates\xadmin\views\model_delete_confirm.html:27 #, python-format msgid "" "Are you sure you want to delete the %(verbose_name)s \"%(escaped_object)s\"? " "All of the following related items will be deleted:" msgstr "" -"Tem certeza de que deseja excluir %(verbose_name)s \"%(escaped_object)s\"? " -"Todos os seguintes itens relacionados serão excluídos:" +"Tem certeza de que deseja excluir %(verbose_name)s \"%(escaped_object)s\" ? " +"Todos os seguintes conteúdos vinculados serão excluídos:" -#: templates/xadmin/views/model_delete_confirm.html:34 -#: templates/xadmin/views/model_delete_selected_confirm.html:49 +#: .\templates\xadmin\views\model_delete_confirm.html:34 +#: .\templates\xadmin\views\model_delete_selected_confirm.html:49 msgid "Yes, I'm sure" msgstr "Sim, tenho certeza" -#: templates/xadmin/views/model_delete_confirm.html:35 -#: templates/xadmin/views/model_delete_selected_confirm.html:50 +#: .\templates\xadmin\views\model_delete_confirm.html:35 +#: .\templates\xadmin\views\model_delete_selected_confirm.html:50 msgid "Cancel" msgstr "Cancelar" -#: templates/xadmin/views/model_delete_selected_confirm.html:10 +#: .\templates\xadmin\views\model_delete_selected_confirm.html:10 msgid "Delete multiple objects" msgstr "Excluir múltiplos objetos" -#: templates/xadmin/views/model_delete_selected_confirm.html:18 +#: .\templates\xadmin\views\model_delete_selected_confirm.html:18 #, python-format msgid "" "Deleting the selected %(objects_name)s would result in deleting related " @@ -1192,7 +1304,7 @@ msgstr "" "relacionados, mas a sua conta não tem permissão para excluir os seguintes " "tipos de objetos:" -#: templates/xadmin/views/model_delete_selected_confirm.html:26 +#: .\templates\xadmin\views\model_delete_selected_confirm.html:26 #, python-format msgid "" "Deleting the selected %(objects_name)s would require deleting the following " @@ -1201,37 +1313,37 @@ msgstr "" "Excluir o %(objects_name)s selecionado exigiria eliminar os seguintes " "objetos protegidos relacionados:" -#: templates/xadmin/views/model_delete_selected_confirm.html:34 +#: .\templates\xadmin\views\model_delete_selected_confirm.html:34 #, python-format msgid "" "Are you sure you want to delete the selected %(objects_name)s? All of the " "following objects and their related items will be deleted:" msgstr "" -"Tem certeza de que deseja excluir o %(objects_name)s selecionado? Todos os " -"seguintes objetos e seus itens relacionados serão excluídos:" +"Tem certeza de que deseja excluir o %(objects_name)s selecionado ? Todos os " +"seguintes conteúdos vinculados serão excluídos:" -#: templates/xadmin/views/model_history.html:26 +#: .\templates\xadmin\views\model_history.html:26 msgid "Diff" msgstr "Comparar" -#: templates/xadmin/views/model_history.html:27 -#: templates/xadmin/views/recover_list.html:25 +#: .\templates\xadmin\views\model_history.html:27 +#: .\templates\xadmin\views\recover_list.html:25 msgid "Date/time" msgstr "Data/Hora" -#: templates/xadmin/views/model_history.html:28 +#: .\templates\xadmin\views\model_history.html:28 msgid "User" msgstr "Usuário" -#: templates/xadmin/views/model_history.html:29 +#: .\templates\xadmin\views\model_history.html:29 msgid "Comment" msgstr "Comentário" -#: templates/xadmin/views/model_history.html:54 +#: .\templates\xadmin\views\model_history.html:54 msgid "Diff Select Versions" msgstr "Comparar Versões Selecionadas" -#: templates/xadmin/views/model_history.html:58 +#: .\templates\xadmin\views\model_history.html:58 msgid "" "This object doesn't have a change history. It probably wasn't added via this " "admin site." @@ -1239,241 +1351,239 @@ msgstr "" "Este objeto não possui um histórico de mudança. Provavelmente não foi " "adicionado pelo site de administração." -#: templates/xadmin/views/model_list.html:29 +#: .\templates\xadmin\views\model_list.html:29 #, python-format msgid "Add %(name)s" msgstr "Adicionar %(name)s" -#: templates/xadmin/views/model_list.html:39 -#, fuzzy +#: .\templates\xadmin\views\model_list.html:39 msgid "Columns" msgstr "Colunas" -#: templates/xadmin/views/model_list.html:42 +#: .\templates\xadmin\views\model_list.html:42 msgid "Restore Selected" msgstr "Restaurar Selecionados" -#: templates/xadmin/views/model_list.html:147 -#: templates/xadmin/widgets/list.html:33 +#: .\templates\xadmin\views\model_list.html:147 +#: .\templates\xadmin\widgets\list.html:33 msgid "Empty list" msgstr "Limpar lista" -#: templates/xadmin/views/recover_form.html:20 +#: .\templates\xadmin\views\recover_form.html:20 msgid "Press the recover button below to recover this version of the object." msgstr "Clique no botão recuperar abaixo para recuperar esta versão do objeto." -#: templates/xadmin/views/recover_list.html:19 +#: .\templates\xadmin\views\recover_list.html:19 msgid "" "Choose a date from the list below to recover a deleted version of an object." msgstr "" "Escolha a data a partir da lista abaixo para recuperar a versão excluída do " "objeto." -#: templates/xadmin/views/recover_list.html:39 +#: .\templates\xadmin\views\recover_list.html:39 msgid "There are no deleted objects to recover." msgstr "Não há objetos excluídos para recuperar." -#: templates/xadmin/views/revision_diff.html:12 -#: templates/xadmin/views/revision_diff.html:17 +#: .\templates\xadmin\views\revision_diff.html:12 +#: .\templates\xadmin\views\revision_diff.html:17 #, python-format msgid "Diff %(verbose_name)s" msgstr "Comparar %(verbose_name)s" -#: templates/xadmin/views/revision_diff.html:25 +#: .\templates\xadmin\views\revision_diff.html:25 msgid "Field" msgstr "Campo" -#: templates/xadmin/views/revision_diff.html:26 +#: .\templates\xadmin\views\revision_diff.html:26 msgid "Version A" msgstr "Versão A" -#: templates/xadmin/views/revision_diff.html:27 +#: .\templates\xadmin\views\revision_diff.html:27 msgid "Version B" msgstr "Versão B" -#: templates/xadmin/views/revision_diff.html:39 +#: .\templates\xadmin\views\revision_diff.html:39 msgid "Revert to" msgstr "Reverter para" -#: templates/xadmin/views/revision_diff.html:40 -#: templates/xadmin/views/revision_diff.html:41 +#: .\templates\xadmin\views\revision_diff.html:40 +#: .\templates\xadmin\views\revision_diff.html:41 msgid "Revert" msgstr "Reverter" -#: templates/xadmin/views/revision_form.html:16 +#: .\templates\xadmin\views\revision_form.html:16 #, python-format msgid "Revert %(verbose_name)s" msgstr "Reverter %(verbose_name)s" -#: templates/xadmin/views/revision_form.html:21 +#: .\templates\xadmin\views\revision_form.html:21 msgid "Press the revert button below to revert to this version of the object." msgstr "" "Clique no botão reverter abaixo para reverter para esta versão do objeto." -#: templates/xadmin/views/revision_form.html:27 +#: .\templates\xadmin\views\revision_form.html:27 msgid "Revert this revision" msgstr "Reverter esta revisão" -#: templates/xadmin/widgets/addform.html:14 +#: .\templates\xadmin\widgets\addform.html:14 msgid "Success" msgstr "Sucesso" -#: templates/xadmin/widgets/addform.html:14 +#: .\templates\xadmin\widgets\addform.html:14 msgid "Add success, click edit to edit." msgstr "Sucesso na adição, clique editar para editar." -#: templates/xadmin/widgets/addform.html:17 +#: .\templates\xadmin\widgets\addform.html:17 msgid "Quick Add" msgstr "Adição Rápida" -#: templates/xadmin/widgets/base.html:31 +#: .\templates\xadmin\widgets\base.html:31 msgid "Widget Options" msgstr "Opções do Widget" -#: templates/xadmin/widgets/base.html:42 +#: .\templates\xadmin\widgets\base.html:42 msgid "Save changes" msgstr "Gravar alterações" -#: views/base.py:315 +#: .\views\base.py:321 msgid "Django Xadmin" msgstr "Django Xadmin" -#: views/base.py:316 +#: .\views\base.py:322 msgid "my-company.inc" msgstr "" -#: views/dashboard.py:186 +#: .\views\dashboard.py:189 msgid "Widget ID" msgstr "ID do Widget" -#: views/dashboard.py:187 +#: .\views\dashboard.py:190 msgid "Widget Title" msgstr "Título do Widget" -#: views/dashboard.py:252 +#: .\views\dashboard.py:255 msgid "Html Content Widget, can write any html content in widget." msgstr "" "Widget de Conteúdo HTML, pode-se escrever qualquer conteúdo html no widget." -#: views/dashboard.py:255 +#: .\views\dashboard.py:258 msgid "Html Content" msgstr "Conteúdo HTML" -#: views/dashboard.py:318 +#: .\views\dashboard.py:321 msgid "Target Model" msgstr "Modelo Alvo" -#: views/dashboard.py:369 +#: .\views\dashboard.py:372 msgid "Quick button Widget, quickly open any page." msgstr "Widget de Botão Rápido, abre rapidamente qualquer página." -#: views/dashboard.py:371 +#: .\views\dashboard.py:374 msgid "Quick Buttons" msgstr "Botões Rápidos" -#: views/dashboard.py:416 +#: .\views\dashboard.py:419 msgid "Any Objects list Widget." msgstr "Widget de listagem de Qualquer Objeto" -#: views/dashboard.py:456 +#: .\views\dashboard.py:459 msgid "Add any model object Widget." msgstr "Widget de adição de qualquer objeto." -#: views/dashboard.py:492 +#: .\views\dashboard.py:495 msgid "Dashboard" msgstr "Painel" -#: views/dashboard.py:633 +#: .\views\dashboard.py:640 #, python-format msgid "%s Dashboard" msgstr "%s Painel" -#: views/delete.py:103 +#: .\views\delete.py:104 #, python-format msgid "The %(name)s \"%(obj)s\" was deleted successfully." msgstr "%(name)s \"%(obj)s\" excluído(a) com sucesso." -#: views/detail.py:173 views/edit.py:211 views/form.py:72 +#: .\views\detail.py:173 .\views\edit.py:210 .\views\form.py:74 msgid "Other Fields" msgstr "Outros Campos" -#: views/detail.py:235 +#: .\views\detail.py:235 #, python-format msgid "%s Detail" msgstr "%s Detalhes" -#: views/edit.py:253 +#: .\views\edit.py:253 msgid "Added." -msgstr "" +msgstr "Adicionado." -#: views/edit.py:255 -#, fuzzy, python-format -#| msgid "Change %s" +#: .\views\edit.py:255 +#, python-format msgid "Changed %s." -msgstr "Alterar %s" +msgstr "Alterado %s" -#: views/edit.py:255 +#: .\views\edit.py:255 msgid "and" -msgstr "" +msgstr "e" -#: views/edit.py:258 +#: .\views\edit.py:258 msgid "No fields changed." -msgstr "" +msgstr "Nenhum campo alterado." -#: views/edit.py:420 +#: .\views\edit.py:421 #, python-format msgid "The %(name)s \"%(obj)s\" was added successfully." msgstr "%(name)s \"%(obj)s\" adicionado(a) com sucesso." -#: views/edit.py:425 views/edit.py:520 +#: .\views\edit.py:426 .\views\edit.py:521 msgid "You may edit it again below." msgstr "Você pode editar novamente abaixo." -#: views/edit.py:429 views/edit.py:523 +#: .\views\edit.py:430 .\views\edit.py:524 #, python-format msgid "You may add another %s below." msgstr "Você pode adicionar outro(a) %s abaixo." -#: views/edit.py:471 +#: .\views\edit.py:472 #, python-format msgid "Change %s" msgstr "Alterar %s" -#: views/edit.py:516 +#: .\views\edit.py:517 #, python-format msgid "The %(name)s \"%(obj)s\" was changed successfully." msgstr "%(name)s \"%(obj)s\" alterado(a) com sucesso." -#: views/form.py:165 -#, fuzzy, python-format +#: .\views\form.py:168 +#, python-format msgid "The %s was changed successfully." -msgstr "%(name)s \"%(obj)s\" alterado(a) com sucesso." +msgstr "%s foi alterado com sucesso." -#: views/list.py:199 +#: .\views\list.py:192 msgid "Database error" msgstr "Erro da base de dados" -#: views/list.py:373 +#: .\views\list.py:369 #, python-format msgid "%s List" msgstr "Lista %s" -#: views/list.py:499 +#: .\views\list.py:498 msgid "Sort ASC" msgstr "Classificação Ascendente" -#: views/list.py:500 +#: .\views\list.py:499 msgid "Sort DESC" msgstr "Classificação Descendente" -#: views/list.py:504 +#: .\views\list.py:503 msgid "Cancel Sort" msgstr "Cancelar Classificação" -#: views/website.py:16 +#: .\views\website.py:17 msgid "Main Dashboard" msgstr "Painel Principal" -#: widgets.py:48 +#: .\widgets.py:53 .\widgets.py:82 msgid "Now" msgstr "Agora" diff --git a/xadmin/locale/pt_BR/LC_MESSAGES/djangojs.mo b/xadmin/locale/pt_BR/LC_MESSAGES/djangojs.mo index 31666c08e..55a3d6087 100644 Binary files a/xadmin/locale/pt_BR/LC_MESSAGES/djangojs.mo and b/xadmin/locale/pt_BR/LC_MESSAGES/djangojs.mo differ diff --git a/xadmin/locale/pt_BR/LC_MESSAGES/djangojs.po b/xadmin/locale/pt_BR/LC_MESSAGES/djangojs.po index 8441f0a9f..e002bdcfe 100644 --- a/xadmin/locale/pt_BR/LC_MESSAGES/djangojs.po +++ b/xadmin/locale/pt_BR/LC_MESSAGES/djangojs.po @@ -1,71 +1,92 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# +# # Translators: # korndorfer , 2013 msgid "" msgstr "" "Project-Id-Version: xadmin-core\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-04-30 23:11+0800\n" +"POT-Creation-Date: 2017-01-24 12:44-0200\n" "PO-Revision-Date: 2013-11-20 12:41+0000\n" "Last-Translator: korndorfer \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/xadmin/language/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" +"xadmin/language/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: static/xadmin/js/xadmin.plugin.actions.js:20 +#: .\xadmin\static\xadmin\js\xadmin.page.dashboard.js:14 +#: .\xadmin\static\xadmin\js\xadmin.plugin.details.js:24 +#: .\xadmin\static\xadmin\js\xadmin.plugin.quick-form.js:178 +msgid "Close" +msgstr "Fechar" + +#: .\xadmin\static\xadmin\js\xadmin.page.dashboard.js:15 +msgid "Save changes" +msgstr "Salvar alterações" + +#: .\xadmin\static\xadmin\js\xadmin.plugin.actions.js:11 msgid "%(sel)s of %(cnt)s selected" msgid_plural "%(sel)s of %(cnt)s selected" msgstr[0] "%(sel)s de %(cnt)s selecionado" msgstr[1] "%(sel)s de %(cnt)s selecionados" -#: static/xadmin/js/xadmin.plugin.revision.js:25 +#: .\xadmin\static\xadmin\js\xadmin.plugin.details.js:25 +msgid "Edit" +msgstr "Editar" + +#: .\xadmin\static\xadmin\js\xadmin.plugin.quick-form.js:179 +msgid "Add" +msgstr "Adicionar" + +#: .\xadmin\static\xadmin\js\xadmin.plugin.revision.js:25 msgid "New Item" msgstr "Novo Item" -#: static/xadmin/js/xadmin.widget.datetime.js:32 +#: .\xadmin\static\xadmin\js\xadmin.widget.datetime.js:32 msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday" msgstr "Domingo Segunda Terça Quarta Quinta Sexta Sábado Domingo" -#: static/xadmin/js/xadmin.widget.datetime.js:33 +#: .\xadmin\static\xadmin\js\xadmin.widget.datetime.js:33 msgid "Sun Mon Tue Wed Thu Fri Sat Sun" msgstr "Dom Seg Ter Qua Qui Sex Sáb Dom" -#: static/xadmin/js/xadmin.widget.datetime.js:34 +#: .\xadmin\static\xadmin\js\xadmin.widget.datetime.js:34 msgid "Su Mo Tu We Th Fr Sa Su" msgstr "Do Sg Te Qa Qi Sx Sa Do" -#: static/xadmin/js/xadmin.widget.datetime.js:35 +#: .\xadmin\static\xadmin\js\xadmin.widget.datetime.js:35 msgid "" -"January February March April May June July August September October November" -" December" -msgstr "Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro" +"January February March April May June July August September October November " +"December" +msgstr "" +"Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro " +"Novembro Dezembro" -#: static/xadmin/js/xadmin.widget.datetime.js:36 +#: .\xadmin\static\xadmin\js\xadmin.widget.datetime.js:36 msgid "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" msgstr "Jan Fev Mar Abr Mai Jun Jul Ago Set Out Nov Dez" -#: static/xadmin/js/xadmin.widget.datetime.js:37 +#: .\xadmin\static\xadmin\js\xadmin.widget.datetime.js:37 msgid "Today" msgstr "Hoje" -#: static/xadmin/js/xadmin.widget.datetime.js:38 +#: .\xadmin\static\xadmin\js\xadmin.widget.datetime.js:38 msgid "%a %d %b %Y %T %Z" msgstr "%a %d %b %Y %T %Z" -#: static/xadmin/js/xadmin.widget.datetime.js:39 +#: .\xadmin\static\xadmin\js\xadmin.widget.datetime.js:39 msgid "AM PM" msgstr "AM PM" -#: static/xadmin/js/xadmin.widget.datetime.js:40 +#: .\xadmin\static\xadmin\js\xadmin.widget.datetime.js:40 msgid "am pm" msgstr "am pm" -#: static/xadmin/js/xadmin.widget.datetime.js:43 +#: .\xadmin\static\xadmin\js\xadmin.widget.datetime.js:43 msgid "%T" msgstr "%T" diff --git a/xadmin/models.py b/xadmin/models.py index f389fd3bd..400f08080 100644 --- a/xadmin/models.py +++ b/xadmin/models.py @@ -45,7 +45,7 @@ def add_view_permissions(sender, **kwargs): @python_2_unicode_compatible class Bookmark(models.Model): title = models.CharField(_(u'Title'), max_length=128) - user = models.ForeignKey(AUTH_USER_MODEL, on_delete=models.CASCADE, verbose_name=_(u"user"), blank=True, null=True) + user = models.ForeignKey(AUTH_USER_MODEL, on_delete=models.CASCADE, verbose_name=_("user"), blank=True, null=True) url_name = models.CharField(_(u'Url Name'), max_length=64) content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) query = models.CharField(_(u'Query String'), max_length=1000, blank=True) @@ -86,7 +86,7 @@ def default(self, o): @python_2_unicode_compatible class UserSettings(models.Model): - user = models.ForeignKey(AUTH_USER_MODEL, on_delete=models.CASCADE, verbose_name=_(u"user")) + user = models.ForeignKey(AUTH_USER_MODEL, on_delete=models.CASCADE, verbose_name=_("user")) key = models.CharField(_('Settings Key'), max_length=256) value = models.TextField(_('Settings Content')) @@ -106,10 +106,10 @@ class Meta: @python_2_unicode_compatible class UserWidget(models.Model): - user = models.ForeignKey(AUTH_USER_MODEL, on_delete=models.CASCADE, verbose_name=_(u"user")) - page_id = models.CharField(_(u"Page"), max_length=256) - widget_type = models.CharField(_(u"Widget Type"), max_length=50) - value = models.TextField(_(u"Widget Params")) + user = models.ForeignKey(AUTH_USER_MODEL, on_delete=models.CASCADE, verbose_name=_("user")) + page_id = models.CharField(_("Page"), max_length=256) + widget_type = models.CharField(_("Widget Type"), max_length=50) + value = models.TextField(_("Widget Params")) def get_value(self): value = json.loads(self.value) diff --git a/xadmin/plugins/__init__.py b/xadmin/plugins/__init__.py index d0611656f..39c1faffc 100644 --- a/xadmin/plugins/__init__.py +++ b/xadmin/plugins/__init__.py @@ -36,6 +36,7 @@ def register_builtin_plugins(site): from importlib import import_module from django.conf import settings + plugins = PLUGINS + tuple(getattr(settings, 'XADMIN_INCLUDE_PLUGINS', ())) exclude_plugins = getattr(settings, 'XADMIN_EXCLUDE_PLUGINS', []) - [import_module('xadmin.plugins.%s' % plugin) for plugin in PLUGINS if plugin not in exclude_plugins] + [import_module('xadmin.plugins.%s' % plugin) for plugin in plugins if plugin not in exclude_plugins] diff --git a/xadmin/plugins/actions.py b/xadmin/plugins/actions.py index d3c244001..38f1770b3 100644 --- a/xadmin/plugins/actions.py +++ b/xadmin/plugins/actions.py @@ -1,5 +1,7 @@ from collections import OrderedDict + from django import forms, VERSION as django_version +from django.contrib.admin.utils import get_deleted_objects from django.core.exceptions import PermissionDenied from django.db import router from django.http import HttpResponse, HttpResponseRedirect @@ -8,10 +10,8 @@ from django.utils import six from django.utils.encoding import force_text from django.utils.safestring import mark_safe -from django.utils.translation import ugettext as _, ungettext from django.utils.text import capfirst - -from django.contrib.admin.utils import get_deleted_objects +from django.utils.translation import ugettext as _, ungettext from xadmin.plugins.utils import get_context_dict from xadmin.sites import site @@ -19,8 +19,6 @@ from xadmin.views import BaseAdminPlugin, ListAdminView from xadmin.views.base import filter_hook, ModelAdminView -from xadmin import views - ACTION_CHECKBOX_NAME = '_selected_action' checkbox = forms.CheckboxInput({'class': 'action-select'}, lambda value: False) @@ -57,10 +55,10 @@ def do_action(self, queryset): def __init__(self, request, *args, **kwargs): super().__init__(request, *args, **kwargs) - if django_version > (2, 0): - for model in self.admin_site._registry: - if not hasattr(self.admin_site._registry[model], 'has_delete_permission'): - setattr(self.admin_site._registry[model], 'has_delete_permission', self.has_delete_permission) + admin_site_registry = self.admin_site._registry + for model in admin_site_registry: + if not hasattr(admin_site_registry[model], 'has_delete_permission'): + setattr(admin_site_registry[model], 'has_delete_permission', self.has_delete_permission) class DeleteSelectedAction(BaseActionView): @@ -99,15 +97,8 @@ def do_action(self, queryset): # Populate deletable_objects, a data structure of all related objects that # will also be deleted. - - if django_version > (2, 1): - deletable_objects, model_count, perms_needed, protected = get_deleted_objects( - queryset, self.opts, self.admin_site) - else: - using = router.db_for_write(self.model) - deletable_objects, model_count, perms_needed, protected = get_deleted_objects( - queryset, self.opts, self.user, self.admin_site, using) - + deletable_objects, model_count, perms_needed, protected = get_deleted_objects( + queryset, self, self.admin_site) # The user has already confirmed the deletion. # Do the deletion and return a None to display the change list view again. @@ -239,13 +230,14 @@ def get_actions(self): class_actions = getattr(klass, 'actions', []) if not class_actions: continue - actions.extend( - [self.get_action(action) for action in class_actions]) + # Allows additional processing for actions. + # May need to select action per user profile. + if callable(class_actions): + class_actions = class_actions(self.admin_view.request) + actions.extend([self.get_action(action) for action in class_actions]) # get_action might have returned None, so filter any of those out. - actions = filter(None, actions) - if six.PY3: - actions = list(actions) + actions = [action for action in actions if action is not None] # Convert the actions into a OrderedDict keyed by name. actions = OrderedDict([ diff --git a/xadmin/plugins/ajax.py b/xadmin/plugins/ajax.py index b09bea21b..cf2ccb7f6 100644 --- a/xadmin/plugins/ajax.py +++ b/xadmin/plugins/ajax.py @@ -43,7 +43,7 @@ def __init__(self, errors, form): super(JsonErrorDict, self).__init__(errors) self.form = form - def as_json(self): + def as_json(self, **kwargs): if not self: return u'' return [{'id': self.form[k].auto_id if k != NON_FIELD_ERRORS else NON_FIELD_ERRORS, 'name': k, 'errors': v} for k, v in self.items()] diff --git a/xadmin/plugins/auth.py b/xadmin/plugins/auth.py index 1ab6f6110..8fce00b96 100644 --- a/xadmin/plugins/auth.py +++ b/xadmin/plugins/auth.py @@ -44,7 +44,7 @@ def label_from_instance(self, p): return get_permission_name(p) -class GroupAdmin(object): +class GroupAdmin: search_fields = ('name',) ordering = ('name',) style_fields = {'permissions': 'm2m_transfer'} @@ -57,7 +57,7 @@ def get_field_attrs(self, db_field, **kwargs): return attrs -class UserAdmin(object): +class UserAdmin: change_user_password_template = None list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff') list_filter = ('is_staff', 'is_superuser', 'is_active') @@ -108,7 +108,7 @@ def get_form_layout(self): return super(UserAdmin, self).get_form_layout() -class PermissionAdmin(object): +class PermissionAdmin: def show_name(self, p): return get_permission_name(p) diff --git a/xadmin/plugins/batch.py b/xadmin/plugins/batch.py index b322af98e..bdda48b18 100644 --- a/xadmin/plugins/batch.py +++ b/xadmin/plugins/batch.py @@ -2,7 +2,7 @@ import copy from django import forms from django.db import models -from django.core.exceptions import PermissionDenied +from django.core.exceptions import PermissionDenied, ImproperlyConfigured from django.forms.models import modelform_factory from django.template.response import TemplateResponse from django.utils.encoding import force_text @@ -36,7 +36,7 @@ def media(self): media = self.widget.media + vendor('xadmin.plugin.batch.js') return media - def render(self, name, value, attrs=None): + def render(self, name, value, attrs=None, **kwargs): output = [] is_required = self.widget.is_required output.append(u'