reinami / sanic_crud Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Cool lib but there was problem with latest release of Sanic and peewee 3.8.0. First was the import error with log
, After fixing that with from sanic.log import logger as log
ended up with an error that points to this:
class CrudShortcuts(object):
def __init__(self, model):
self.table_name = model._meta.db_table
self.model = model
I get the following error.
self.table_name = model._meta.db_table AttributeError: 'Metadata' object has no attribute 'db_table'
This is a great handy lib. Will be nice to get a fix.
That's more a question, is it possible to limit number of HTTP methods for a resource?
e.g. I'd like only allow POST and GET ?
Or any other way to prevent users from modifying data?
Let's assume I have a BLOG page where admin user should be allowed to create, delete, modify and view posts, but user should be only allowed to fetch list of posts or a particular one. How do I achieve that? Unfortunately could not find anything in the docs.
Having validations be part of the peewee model would be better, as we could verify it on save very easily.
Quick cleanup of code, see if there are better ways to organize and optimize
Need to test the following:
Resources could be reorganized to be a bit nicer.
This seems pretty janky right now. its all located in the validation wrapper in helpers.py
If you set a config on a model and also have a base route, it will completely overwrite the base route. Set it up so it is possible to only list the changes you want in the model and it will overwrite only the changed fields in the config.
Noob here. I have this error
ImportError: cannot import name 'generate_crud'
when I try to run example code for sanic_crud
I have this installed, should be ok, but seems I am missing some info, any help?
aiofiles (0.3.2)
httptools (0.0.10)
peewee (2.8.5)
pip (9.0.1)
Sanic (0.3.0)
sanic-crud (0.2.4)
setuptools (28.8.0)
ujson (1.35)
uvloop (0.9.1)
websockets (4.0.1)
Write tests for querying I.E. /person?id__gt=1
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.