Hi there, I'm Kirill 👋
- 🔭 I’m currently working on Muffin ecosystem
- 🌱 I’m currently learning Rust
- 💬 Ask me about anything here
- 📫 How to reach me: [email protected]
Another django rest framework
License: GNU Lesser General Public License v3.0
Интересное гибкое и расширяемое решение из django-rest-framework по подключению дефолтных моделей.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1428282-django-rest-framework?utm_campaign=plugin&utm_content=tracker%2F340801&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F340801&utm_medium=issues&utm_source=github).Hi @klen,
I'm looking for a rest solution for my-self.
Even though django-rest-framework is very good, it seems too much for my case.
I liked your adrest & tastypie projects. I haven't looked into code base but just went through the main pages of both.
For me, both (adrest & tastypie) seems very very similar. Only notable difference I found is that your's using api versions & other is using api naming. And yes, your example looks more neat.
But, is there any good features in adrest that's not in tastypie?
Use standart http library
If raise HttpError with no string content (dict as example) it bring into unicode.
https://github.com/klen/adrest/blob/master/adrest/views.py#L170
If use python structures for HttpError/HttpResponse content we can create more usable response which can be serialized by given emitter.
subj
The actual code of this package looks very useful at first sight in comparison with tastypie and djangrestframework, as it seems to be more flexible than both and has a good middleway when it comes to coding practises.
However, it having no documentation whatsoever makes it an unacceptable choice in any development project. So please try to explain at least:
And preferably: how to get started with builing an API. Also, knowing the level of automated testing used during development is good to, at least, evaluate it.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1428283-add-basic-documentation?utm_campaign=plugin&utm_content=tracker%2F340801&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F340801&utm_medium=issues&utm_source=github).I think it should return 404!
Привет.
https://github.com/klen/adrest/blob/master/adrest/resources/rpc.py#L101
Вот в этом куске кода в rpc_call аргумент **kwargs
он переопределяется умышленно или баг? В метод rpc хочется передавать дополнительные параметры типа объекта авторизации, но чтобы это сделать, надо в унаследованном rpc ресурсе переопределять всю логику метода rpc_call, без возможности вызвать родительский rpc_call, что не есть гуд.
Its maybe little implementation of https://github.com/barbuza/jsroutes
It can help to use simple reverse function in javascript code:
var url = adrest_api("1.0.0-resource-name", [arg1, arg2, args])
No need to know any more about url structure to build url. Only endpoint name and arguments.
Есть мнение, subj.
response.content[:5000]
Если там юникодный контент — то все ложится.
response.content сам по себе имеет тип str.
Предлагаю делать ему .decode('utf-8'), а потом уже резать по длине.
Тем более все-равно в базу оно сохраняется как utf.
Traceback (most recent call last):
File "/.virtualenv/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, _callback_args, *_callback_kwargs)
File "/.virtualenv/lib/python2.6/site-packages/django/views/generic/base.py", line 47, in view
return self.dispatch(request, _args, *_kwargs)
File "/.virtualenv/lib/python2.6/site-packages/django/views/decorators/csrf.py", line 39, in wrapped_view
resp = view_func(_args, *_kwargs)
File "/.virtualenv/lib/python2.6/site-packages/django/views/decorators/csrf.py", line 52, in wrapped_view
return view_func(_args, *_kwargs)
File "/.virtualenv/lib/python2.6/site-packages/adrest/views.py", line 94, in dispatch
api_request_finished.send(self, request=self.request, response=response)
File "/.virtualenv/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/.virtualenv/lib/python2.6/site-packages/adrest/models.py", line 48, in save_log
response = response.content[:5000],
File "/.virtualenv/lib/python2.6/site-packages/django/db/models/manager.py", line 138, in create
return self.get_query_set().create(**kwargs)
File "/.virtualenv/lib/python2.6/site-packages/django/db/models/query.py", line 360, in create
obj.save(force_insert=True, using=self.db)
File "/.virtualenv/lib/python2.6/site-packages/django/db/models/base.py", line 460, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/.virtualenv/lib/python2.6/site-packages/django/db/models/base.py", line 553, in save_base
result = manager._insert(values, return_id=update_pk, using=using)
File "/.virtualenv/lib/python2.6/site-packages/django/db/models/manager.py", line 195, in _insert
return insert_query(self.model, values, **kwargs)
File "/.virtualenv/lib/python2.6/site-packages/django/db/models/query.py", line 1436, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/.virtualenv/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 791, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)
File "/.virtualenv/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 735, in execute_sql
cursor.execute(sql, params)
File "/.virtualenv/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
return self.cursor.execute(query, args)
DatabaseError: invalid byte sequence for encoding "UTF8": 0xd020
'REQUEST_METHOD': 'GET',
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.