1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

433 Commits

Author SHA1 Message Date
Jeremy Stretch
de7207de55 Enable dictionary specification of related objects in API 2019-04-16 18:02:52 -04:00
Jeremy Stretch
bf2f314cd4 Remove run_validators() override (fixed upstream) 2019-04-16 15:35:15 -04:00
John Anderson
4723ddb5ce move caching to views 2019-04-15 14:41:04 -04:00
John Anderson
cdff29c7d5 add redis to travis builds 2019-04-15 04:16:22 -04:00
John Anderson
f0505477b8 intial work on #2647 - caching 2019-04-15 03:55:33 -04:00
Jeremy Stretch
df0686a1bd Implement custom auth backend and EXEMPT_VIEW_PERMISSIONS setting 2019-04-11 22:01:26 -04:00
Jeremy Stretch
e710ccb0e6 Enforce view permissions for UI views 2019-04-11 17:27:38 -04:00
Jeremy Stretch
c8cccc30d1 Merge branch 'develop' into develop-2.6 2019-04-02 13:12:34 -04:00
Jeremy Stretch
d23ca041cf Ensure fallback to default serializer when attempting to load nested serializer 2019-04-02 11:17:14 -04:00
Jeremy Stretch
fc76c8eb0f FieldChoicesViewSet should infer field choices from serializer, not model 2019-03-22 16:24:53 -04:00
Jeremy Stretch
0b95016e00 Merge branch 'develop' into develop-2.6 2019-03-11 21:01:18 -04:00
Jeremy Stretch
7e70bfaacc Fixes #2985: Fix pagination page length for rack elevations 2019-03-11 12:51:03 -04:00
Jeremy Stretch
1995091169 Changelog & renaming for #2065 2019-03-07 13:58:34 -05:00
Jeremy Stretch
ef089d3722 Merge pull request #2957 from axnsan12/ref-name
Resolve drf-yasg `ref_name` conflicts
2019-03-07 13:52:29 -05:00
Jeremy Stretch
ab02f26a0e Fixes #2972: Improve ContentTypeField serializer to elegantly handle invalid data 2019-03-06 12:42:47 -05:00
Jeremy Stretch
c52d077f92 Merge branch 'develop' into develop-2.6 2019-03-05 13:39:00 -05:00
Cristi Vîjdea
3a62e9a322 Resolve drf-yasg ref_name conflicts
This solves the problem of distinct serializers being confused because they have the same class name (e.g. `InterfaceSerializer`)

Fixes #2065.
2019-03-04 03:49:26 +02:00
dansheps
f2471aedb2 Fixes #2781: Fixes filter by regions on site and device list 2019-02-27 11:41:12 -06:00
John Anderson
fc2bb724fa initial pass on migrating to custom tag model with color and comments fields 2019-02-20 03:52:47 -05:00
Jeremy Stretch
7a0ab3aa15 Fixes #2895: Fix filtering of nullable character fields 2019-02-14 09:43:56 -05:00
Jeremy Stretch
fdbef8ee71 Closes #2836: Deprecate NullableCharField 2019-02-14 09:39:04 -05:00
John Anderson
613e8f05c2 fixes #2835 - certain model filters did not support the q query param 2019-01-31 13:36:30 -05:00
Jeremy Stretch
dc70fdbe03 Force string formatting of integer values 2019-01-29 13:57:19 -05:00
Jeremy Stretch
14695037da Strip return characters when removing line breaks 2019-01-18 09:24:32 -05:00
John Anderson
17d6584ef4 removed deprecated code 2019-01-10 21:23:22 -05:00
John Anderson
ad4fb3ce8b IPAM Select2 forms and changelog 2019-01-10 21:19:13 -05:00
John Anderson
6dcd48fef1 Virtulization Select2 forms 2019-01-10 17:32:23 -05:00
John Anderson
bf8d57c7d1 DCIM filter forms select2 2019-01-08 15:35:34 -08:00
John Anderson
6d5d9c8af3 implemented #2590 - improved color picker with actual colors 2019-01-05 17:43:42 -05:00
John Anderson
c27cea981c select2 for all create/edit forms in dcim 2019-01-04 14:41:36 -05:00
John Anderson
fca97f9768 Merge branch 'develop' of github.com:digitalocean/netbox into select2-ui 2019-01-04 12:44:41 -05:00
John Anderson
7a5a73ce34 fixed whitespace 2019-01-04 12:44:31 -05:00
John Anderson
81a0889568 initial static select2 fields 2019-01-03 23:02:05 -05:00
Jeremy Stretch
0a820d9c98 Closes #1871: Enable filtering sites by parent region 2019-01-03 16:59:49 -05:00
Jeremy Stretch
6ca045e1a9 Merge pull request #2694 from DanSheps/2693-fiber-cable-colors
Closes #2693 - Adds additional colors for cables & roles
2019-01-03 15:24:36 -05:00
John Anderson
5285b6926f updated filter-for attr handling 2019-01-03 03:00:27 -05:00
John Anderson
28a02e9943 initial select2 support 2018-12-30 02:35:18 -05:00
Jeremy Stretch
853b1fad15 Fixes #2712: Preserve list filtering after editing objects in bulk 2018-12-20 15:33:53 -05:00
Jeremy Stretch
f4a22e5af3 Introduced fgcolor template filter to render ideal foreground color for any background color 2018-12-19 12:17:40 -05:00
Jeremy Stretch
aca57ec281 Fixes #2698: Remove pagination restriction on bulk component creation for devices/VMs 2018-12-19 10:59:12 -05:00
dansheps
f499f2dd66 Closes #2693 2018-12-14 11:51:20 -06:00
Jeremy Stretch
8364e56e86 Fixes #2676: Fix exception when passing dictionary value to a ChoiceField 2018-12-11 17:00:20 -05:00
Jeremy Stretch
65edffea63 Merge v2.5 work 2018-12-07 10:51:28 -05:00
Jeremy Stretch
2a07e8f3f0 Move queryset_to_csv() utility into ObjectListView to allow overriding by individual views 2018-12-05 16:35:59 -05:00
Jeremy Stretch
686a65880e Closes #2495: Enable deep-merging of config context data 2018-12-05 14:34:49 -05:00
Jeremy Stretch
08b4b24296 Fixes #2622: Enable filtering cables by multiple types/colors 2018-11-28 14:22:55 -05:00
Tatsushi Demachi
c3cdf8e97e Fix type mismatches in API view (#2429)
* Fix tags field to be shown as array in API view

`tags` field in serializers is defineded as `TagListSerializerField`.
It should be shown as an array value in API view but actually, it is a
simple string value.

This fixes it by introducing a new `FieldInspector` to handle
`TagListSerializerField` type field as an array. It doesn't affects any
other type fields.

* Fix SerializedPKRelatedField type API expression

A field definded as `SerializedPKRelatedField` should be shown as an
array of child serializer objects in a response value definition in API
view but it is shown as an array of primary key values (usually
`integer` type) of a child serializer.

This fixes it by introducing a new `FieldInspector` to handle the field.
It doesn't affect any other type fields.

* Fix request parameter representation in API view

In API view, representation of a parameter defined as a sub class of
`WritableNestedSerializer` should be vary between a request and a
response. For example, `tenant` field in `IPAddressSerializer` should be
shown like following as a request body:

```
tenant: integer ...
```

while it should be shown like following as a response body:

```
tenant: {
    id: integer ...,
    url: string ...,
    name: string ...,
    slug: string ...
}
```

But in both cases, it is shown as a response body type expression. This
causes an error at sending an API request with that type value.

It is only an API view issue, API can handle a request if a request
parameter is structured as an expected request body by ignoring the
wrong expression.

This fixes the issue by replacing an implicitly used default auto schema
generator class by its sub class and returning a pseudo serializer with
'Writable' prefix at generating a request body. The reason to introduce
a new generator class is that there is no other point which can
distinguish a request and a response. It is not enough to distinguish
POST, PUT, PATCH methods from GET because former cases may return a JSON
object as a response but it is also represented as same as a request
body, causes another mismatch.

This also fixes `SerializedPKRelatedField` type field representation. It
should be shown as an array of primary keys in a request body.

Fixed #2400
2018-11-27 16:14:45 -05:00
Jeremy Stretch
bd7aee7c1f Closes #2614: Simplify calls of super() for Python 3 2018-11-27 10:52:24 -05:00
Jeremy Stretch
7d8ae5e763 Fixes #2609: Fixed exception when ChoiceField integer value is passed as a string 2018-11-26 14:05:57 -05:00
Jeremy Stretch
2bae50f501 Enforce consistent ordering of value/label keys for ChoiceField 2018-11-26 14:02:38 -05:00