aio-libs / aiohttp-admin Goto Github PK
View Code? Open in Web Editor NEWadmin interface for aiohttp application http://aiohttp-admin.readthedocs.io
License: Apache License 2.0
admin interface for aiohttp application http://aiohttp-admin.readthedocs.io
License: Apache License 2.0
There is plans to migrate to react with admin-on-rest
[1] UI framework since ng-admin
uses outdated angular.
[1] https://github.com/marmelab/admin-on-rest
ng-admin
stuffI'm trying to run examples but can't install dev dependencies
$ pip install -r requirements-dev.txt
Collecting aiohttp-jinja2==0.16.0 (from -r requirements-dev.txt (line 1))
Could not find a version that satisfies the requirement aiohttp-jinja2==0.16.0 (from -r requirements-dev.txt (line 1)) (from versions: 0.0.1, 0.0.2, 0.1.0, 0.2.1, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.5.0, 0.6.1, 0.6.2, 0.7.0, 0.8.0, 0.12.0, 0.13.0, 0.14.0, 0.15.0)
No matching distribution found for aiohttp-jinja2==0.16.0 (from -r requirements-dev.txt (line 1))
Environment:
$ python -V
Python 3.5.2
$ pip -V
pip 9.0.2 from /home/goliney/.virtualenvs/aiohttp_admin/lib/python3.5/site-packages (python 3.5)
$git log -1
commit 9a024868b52ed9e4235e68ffb0ce50c1d2f19dc4
Author: Arfey <[email protected]>
Date: Wed Mar 21 21:24:57 2018 +0200
updated the code to new version of aiohttp, fixed some typos and decorated html (#339)
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
Please help
We could use the children attribute to consider displaying 1-to-many relationships:
https://marmelab.com/react-admin/Resource.html#children
https://marmelab.com/react-admin/Resource.html#nested-resources
Investigate jwt tockens
Some build tools like Bazel
uses symlinks for source files, this causes problem with static files.
https://github.com/aio-libs/aiohttp_admin/blob/v0.0.3/aiohttp_admin/admin.py#L81 - add_static
is called with default param follow_symlinks=False
. Looks like aiohttp_admin.setup and admin.setup_admin_handlers should have additional params follow_symlinks
.
It is possible to generate config.js
base on information about schema. Possible solution would be to use regular jinja2 templates to render js mark up.
Now we have custom scripts like login.js
, it would be nice to have javascript linter to check it on each PR.
mongo_utils.apply_trafaret(t.List(t.String), ['123'])
returns DataError
For some reason in the lists case list_trafaret is applied to elements of list
That's it
Dependabot couldn't authenticate with https://pypi.python.org/simple/.
You can provide authentication details in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'.
Hello some of the demos on this repo reference
the aiohttp_admin.contrib module
which is not available in vs 0.0.3.
I would like to follow along with the examples using the pypi package
To run demo follow instructions here: https://github.com/aio-libs/aiohttp_admin/blob/master/demos/motortwit/README.rst
@goliney could you take a look?
Try to reuse most of code from aiopg version, and implement only differences.
NotImplementedError: Validator for type NUMERIC(10, 2) not implemented
I observed the same for Decimal
I tried to do pip install aiohttp-admin
and pip install aiohttp_admin
- and got a Could not find a version that satisfies the requirement
message from pip.
The best way to install it I found so far is pip install -e .
Is there a better way to include aiohttp_admin
into user's project?
Machine was the only way to run Docker on Mac or Windows previous to Docker v1.12.
(from the docs)
I would like to try and switch from docker machine to just docker.
DOCKER_MACHINE_IP
option is spread in places it shouldn't be (e.g. polls app it overrides host from config)Do you planning to add asyncpg support?
SimpleType
is defined as t.Int | t.Bool | t.String | t.Float
which is used to validate ListQuery and Filters, in particular. During this validation it converts int-like strings to int. Later the filters are created with respect to collection schema. The value gets checked again but it is not string anymore which results in an error.
So a quick example of this error: you have a string column and you are trying to use int-like value in a filter.
There's a related trafaret issue. Usage of newly-introduced Raw-types is suggested.
We could customise the ready screen to display links to aiohttp-admin documentation or similar:
https://marmelab.com/react-admin/Admin.html#ready
Integrate aiohttp_session and aiohttp_security for auth
ng-admin currently compiled and minified with all possible dependencies. I think having some sort of debug mode, when sources of ng-admin are readable, could be very helpful.
@goliney is it possible to build ng-admin without minification or attach source maps somehow?
It is possible to add support for UUID types (sqlalchemy.dialects.postgresql.base.UUID and sqlalchemy_utils.types.uuid.UUIDType) in backend/sa_utils.py ?
And add serialize for UUID and Enum types in utils.py ?
Project for inspiration:
https://github.com/groveco/django-sql-explorer
ERROR:aiohttp.server:Error handling request
Traceback (most recent call last):
File "/home/oscar/.pyenv/versions/ads/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 390, in start
resp = await self._request_handler(request)
File "/home/oscar/.pyenv/versions/ads/lib/python3.6/site-packages/aiohttp/web_app.py", line 352, in _handle
resp = await handler(request)
File "/home/oscar/.pyenv/versions/ads/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 106, in impl
return await handler(request)
File "/home/oscar/.pyenv/versions/ads/lib/python3.6/site-packages/aiohttp_session/init.py", line 149, in factory
response = await handler(request)
File "/home/oscar/.pyenv/versions/ads/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 106, in impl
return await handler(request)
File "/home/oscar/.pyenv/versions/ads/lib/python3.6/site-packages/aiohttp_admin/backends/mongo.py", line 47, in list
count = await self._collection.find(query).count()
AttributeError: 'AsyncIOMotorCursor' object has no attribute 'count'
The later tool is much cooler and allows to detect coverage misses better
For example, I create some resource and I wanna take custom handlers about save resources. à la Django signals
text-ferret_1 | Postgres is up - continuing...
text-ferret_1 | INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
text-ferret_1 | INFO [alembic.runtime.migration] Will assume transactional DDL.
text-ferret_1 | Traceback (most recent call last):
text-ferret_1 | File "/usr/local/bin/adev", line 8, in <module>
text-ferret_1 | sys.exit(cli())
text-ferret_1 | File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
text-ferret_1 | return self.main(*args, **kwargs)
text-ferret_1 | File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
text-ferret_1 | rv = self.invoke(ctx)
text-ferret_1 | File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
text-ferret_1 | return _process_result(sub_ctx.command.invoke(sub_ctx))
text-ferret_1 | File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
text-ferret_1 | return ctx.invoke(self.callback, **ctx.params)
text-ferret_1 | File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
text-ferret_1 | return callback(*args, **kwargs)
text-ferret_1 | File "/usr/local/lib/python3.7/site-packages/aiohttp_devtools/cli.py", line 84, in runserver
text-ferret_1 | run_app(*_runserver(**active_config))
text-ferret_1 | File "/usr/local/lib/python3.7/site-packages/aiohttp_devtools/runserver/main.py", line 45, in runserver
text-ferret_1 | config.import_app_factory()
text-ferret_1 | File "/usr/local/lib/python3.7/site-packages/aiohttp_devtools/runserver/config.py", line 134, in import_app_factory
text-ferret_1 | module = import_module(module_path)
text-ferret_1 | File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
text-ferret_1 | return _bootstrap._gcd_import(name[level:], package, level)
text-ferret_1 | File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
text-ferret_1 | File "<frozen importlib._bootstrap>", line 983, in _find_and_load
text-ferret_1 | File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
text-ferret_1 | File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
text-ferret_1 | File "<frozen importlib._bootstrap_external>", line 728, in exec_module
text-ferret_1 | File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
text-ferret_1 | File "/report/report/app.py", line 13, in <module>
text-ferret_1 | from .admin import setup_admin
text-ferret_1 | File "/report/report/admin.py", line 1, in <module>
text-ferret_1 | import aiohttp_admin
text-ferret_1 | File "/src/aiohttp-admin/aiohttp_admin/__init__.py", line 5, in <module>
text-ferret_1 | from .admin import (
text-ferret_1 | File "/src/aiohttp-admin/aiohttp_admin/admin.py", line 8, in <module>
text-ferret_1 | from .utils import json_response, validate_payload, LoginForm
text-ferret_1 | File "/src/aiohttp-admin/aiohttp_admin/utils.py", line 50, in <module>
text-ferret_1 | SimpleType = t.IntRaw | t.Bool | t.String | t.FloatRaw
text-ferret_1 | AttributeError: module 'trafaret' has no attribute 'IntRaw'
Hi guys,
Hope you are all well !
I was giving a try to aio-libs and I saw that ng-admin was integrated but it would be awesome and more interesting to add, from the same authors, admin-on-rest for a maetrial ui and reactjs version of the admin interface. ( link). It would fit greatly also with https://github.com/searchkit/searchkit.
Some others related links that could fit perfectly with aio-libs:
Can you estimate how complicated it would be ? Have you already discussed that ?
Have a great day !
Cheers,
Richard
We should reduce the timeout on hiding the notification, but also see if we can disable the auto hide behaviour on error messages:
https://marmelab.com/react-admin/Admin.html#notification
The configuration file is written in JavaScript. Are you kidding me? Why developers are hard to be developers?
two two Three, two two Three, six six six
We could consider providing a custom dashboard:
https://marmelab.com/react-admin/Admin.html#dashboard
Hi there, when can I expect a new release of the source code?
Thanks for your product. It helps much.
In admin-panel some list resources that have enum property
class AuthConfirmType(enum.Enum):
SMS = "СМС"
BIRTH_DAY = "Дата рождения"
settings = sa.Table(
"settings",
meta,
sa.Column("id", sa.Integer(), primary_key=True),
.....
sa.Column(
"auth_confirm_by",
sa.Enum(AuthConfirmType),
nullable=True,
)
)
In admin-panel I catch error on detail-action.
if I change enums on this (add str
)
class AuthConfirmType(str, enum.Enum):
SMS = "СМС"
BIRTH_DAY = "Дата рождения"
I will catch misleading value, that no will use properly.
To hook this misbehavior need override jsonEncoder, but in PGResource
I can't use mixins, ( only copy-paste,
It's pain
Every time there is an error in my request to the backend
I am logged out of admin. using master branch.
@goliney could you check this ?
This results in exceptions during passing validation errors to frontend in util.py and mongo_utils.py (lines with **exc.as_dict()
)
There's also a related trafaret issue but currently trafaret may return strings so maybe aiohttp_admin should take this into account.
Looks like you can't use both $gt and $lt in the filter.
mongo_utils.create_filter
creates dict for query and then iterates through operators and assigns operator to the fiels in mongo_utils.op
instead of adding it. One possible solution could be creating default dict with dict factory instead of dict in mongo_utils.create_filter
and updating it in mongo_utils.op
.
Please never use underscores in python-packages names.
Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.
We have a really problem. When our build system convert all dependencies to RPM (using FPM) yum is broken. We are can't use this package in our projects.
I have already installed aiohttp_admin but there arent anything in the documentation what to do after installing. What i need to import and where i need to do it. Please can you write it in the documentation.
5.51s$ yarn install
yarn install v0.17.0
$ rm -rf ./aiohttp_admin/static/ng-admin/
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error An unexpected error occurred: "ENOENT: no such file or directory, lstat '/home/travis/.cache/yarn/npm-angular-ui-codemirror-0.3.0-9246cd11e9b9a986ea553788a20a0be677f171f0'".
info If you think this is a bug, please open a bug report with the information provided in "/home/travis/build/aio-libs/aiohttp_admin/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
for example see https://travis-ci.org/aio-libs/aiohttp_admin/jobs/176128987
@goliney not urgent, please take a look on free time
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.