Commit ff850d6f authored by Zdeněk Böhm's avatar Zdeněk Böhm
Browse files

Add basic code.

parent c51958b6
from django.urls import include, re_path
from cms.models.pluginmodel import CMSPlugin
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
@plugin_pool.register_plugin
class VerifyVatNumberPlugin(CMSPluginBase):
model = CMSPlugin
render_template = "djangocms_verify_vat_number/plugin.html"
def get_plugin_urls(self):
urlpatterns = [
re_path(r'^vvn/', include(('django_verify_vat_number.urls', 'django_verify_vat_number'),
namespace='vvn')),
]
return urlpatterns
# document.getElementsByClassName("verify-vat-number-urls")[0].dataset.vat_id_url
# document.getElementsByClassName("verify-vat-number-urls")[0].dataset.vat_reg_url
# '/cs/admin/cms/page/plugin/verify_vat_number_plugin/vvn/verify-vat-id-number/'
# '/cs/admin/cms/page/plugin/verify_vat_number_plugin/vvn/verify-vat-reg-number/'
console.log("Module static verify.js.")
{% load staticfiles sekizai_tags %}
{% addtoblock "js" %}<script type="text/javascript" class="cms-execute-js-to-render cms-trigger-event-document-DOMContentLoaded" src="{% static "djangocms_verify_vat_number/js/verify.js" %}"></script>{% endaddtoblock %}
<span class="verify-vat-number-urls"
data-vat_id_url="{% url "admin:vvn:verify_vat_id_number" %}"
data-vat_reg_url="{% url "admin:vvn:verify_vat_reg_number" %}"
></span>
[metadata]
name = djangocms-verify-vat-number
version = file:VERSION
description = DjangoCMS Verify VAT number by ARES/VIES
long_description = file: README.md
long_description_content_type = text/markdown
license = GPLv3+
author = Zdeněk Böhm
author_email = zdenek.bohm@nic.cz
classifiers =
Typing :: Typed
Programming Language :: Python
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Framework :: Django CMS :: 3.7
[options]
zip_safe = false
python_requires = ~=3.8
packages = find:
include_package_data = true
install_requires =
django-verify-vat-number ~= 1.0
django-cms >= 3.7.4
setup_requires =
babel
[options.extras_require]
quality =
doc8
flake8
isort
mypy
pydocstyle
test =
responses
types =
types-requests
[compile_catalog]
domain = django
directory = djangocms_verify_vat_number/locale
[flake8]
max-line-length = 120
max-complexity = 15
[mypy]
disallow_untyped_defs = true
disallow_incomplete_defs = true
[mypy-django_verify_vat_number.tests.*]
disallow_untyped_defs = false
[mypy-verify_vat_number.*]
ignore_missing_imports = True
[mypy-django.*]
ignore_missing_imports = True
[mypy-appsettings.*]
ignore_missing_imports = True
[mypy-pycountry.*]
ignore_missing_imports = True
[isort]
line_length = 120
known_first_party = djangocms_verify_vat_number
known_third_party =
django_verify_vat_number
verify_vat_number
combine_as_imports = true
[pydocstyle]
add_select = D204,D400,D401
add_ignore = D105,D106,D107
match_dir = (?!migrations|\.).*
[doc8]
max-line-length = 120
allow-long-titles = true
from distutils.command.build import build
from setuptools import setup
class custom_build(build):
sub_commands = [('compile_catalog', lambda x: True)] + build.sub_commands
setup(cmdclass={'build': custom_build})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment