ebertti / django-admin-easy

Collection of admin fields and decorators to help to create computed or custom fields more friendly and easy way
https://pypi.org/project/django-admin-easy/
MIT License
465 stars 28 forks source link

Admin custom QuerySet data #45

Closed mmmcorpsvit closed 4 years ago

mmmcorpsvit commented 5 years ago

Try use custom nodatabase source of data for admin part (in my case rediSQL), but cannot understand how make custom query and fill manual QuerySet. This battery can do this? Please help(

how i try, in admin

class MqttLogAdmin(admin.ModelAdmin):
    def get_queryset(self, request):
        q = exdb("SELECT * FROM nodes_mqttlog") # just return list of values

        none_qs = MqttLog.objects.none()
        none_qs.create(owner=None, client_id=4, topic='rtrth', payload='{"test": "ok"}', timestamp=timezone.now,)

but this not work, many hours play with qs.values... but not work in any case very need simple universal way for custom datasource for admin, or maybe you know another battery for do this, please help