mirror of
https://github.com/daniviga/bite.git
synced 2024-11-24 22:06:13 +01:00
Compare commits
2 Commits
b5a16f03bc
...
91b9c09c2b
Author | SHA1 | Date | |
---|---|---|---|
91b9c09c2b | |||
b6d0fb85c9 |
|
@ -2,7 +2,7 @@
|
||||||
* vim: tabstop=2 shiftwidth=2 softtabstop=2
|
* vim: tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
*
|
*
|
||||||
* BITE - A Basic/IoT/Example
|
* BITE - A Basic/IoT/Example
|
||||||
* Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
* Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
*
|
*
|
||||||
* BITE is free software: you can redistribute it and/or modify
|
* BITE is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* vim: tabstop=2 shiftwidth=2 softtabstop=2
|
* vim: tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
*
|
*
|
||||||
* BITE - A Basic/IoT/Example
|
* BITE - A Basic/IoT/Example
|
||||||
* Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
* Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
*
|
*
|
||||||
* BITE is free software: you can redistribute it and/or modify
|
* BITE is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
@ -17,8 +17,9 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from datetime import datetime
|
|
||||||
from django.http import Http404
|
from django.http import Http404
|
||||||
|
from django.utils import timezone
|
||||||
|
from django.utils.dateparse import parse_datetime
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
from rest_framework.viewsets import ModelViewSet
|
from rest_framework.viewsets import ModelViewSet
|
||||||
|
|
||||||
|
@ -26,6 +27,7 @@ from telemetry.models import Telemetry
|
||||||
from telemetry.serializers import (TelemetrySerializer,
|
from telemetry.serializers import (TelemetrySerializer,
|
||||||
TelemetrySummarySerializer)
|
TelemetrySummarySerializer)
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
|
from rest_framework.exceptions import ParseError
|
||||||
|
|
||||||
|
|
||||||
class TelemetryView(ModelViewSet):
|
class TelemetryView(ModelViewSet):
|
||||||
|
@ -66,8 +68,21 @@ class TelemetryRange(ModelViewSet):
|
||||||
serializer_class = TelemetrySerializer
|
serializer_class = TelemetrySerializer
|
||||||
lookup_field = 'device'
|
lookup_field = 'device'
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def datetime_validation(datetime):
|
||||||
|
parsed_datetime = parse_datetime(datetime)
|
||||||
|
if parsed_datetime is None:
|
||||||
|
raise ParseError({
|
||||||
|
datetime: 'Invalid date format'
|
||||||
|
})
|
||||||
|
return timezone.make_aware(parsed_datetime)
|
||||||
|
|
||||||
def list(self, request, device, time_from, time_to=None):
|
def list(self, request, device, time_from, time_to=None):
|
||||||
time_to = datetime.now() if time_to is None else time_to
|
time_from = self.datetime_validation(time_from)
|
||||||
|
time_to = (
|
||||||
|
timezone.now() if time_to is None else
|
||||||
|
self.datetime_validation(time_to)
|
||||||
|
)
|
||||||
queryset = Telemetry.objects.filter(
|
queryset = Telemetry.objects.filter(
|
||||||
device__serial=device,
|
device__serial=device,
|
||||||
time__range=[time_from, time_to])
|
time__range=[time_from, time_to])
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: syntax=python tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: syntax=python tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: syntax=nginx tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: syntax=nginx tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
# vim: tabstop=2 shiftwidth=2 softtabstop=2
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: syntax=dockerfile tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: syntax=dockerfile tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
#
|
#
|
||||||
# BITE - A Basic/IoT/Example
|
# BITE - A Basic/IoT/Example
|
||||||
# Copyright (C) 2020 Daniele Viganò <daniele@vigano.me>
|
# Copyright (C) 2020-2021 Daniele Viganò <daniele@vigano.me>
|
||||||
#
|
#
|
||||||
# BITE is free software: you can redistribute it and/or modify
|
# BITE is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
Loading…
Reference in New Issue
Block a user