Skip to content
This repository was archived by the owner on Aug 28, 2018. It is now read-only.

Commit db1e41a

Browse files
author
misazr
committed
Organize libraries
1 parent 649852f commit db1e41a

File tree

4 files changed

+8
-21
lines changed

4 files changed

+8
-21
lines changed

netbox-graphql/circuits_schema.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
1-
from graphene import AbstractType
2-
from graphene import Node
31
from graphene_django.filter import DjangoFilterConnectionField
42
from graphene_django.types import DjangoObjectType
3+
from graphene import AbstractType, Field, Node, ClientIDMutation, AbstractType
4+
from graphql_relay.node.node import from_global_id
5+
from graphene import ID, Boolean, Float, Int, List, String
56

67
from circuits.models import CircuitType, Circuit, Provider, CircuitTermination
78
from dcim.models import Site, Interface
89
from tenancy.models import Tenant
910
from .custom_filter_fields import date_types, string_types, number_types
1011
from .helper_methods import not_none, set_and_save
1112

12-
from graphene import AbstractType
13-
from graphene import Field
14-
from graphene import Node
15-
from graphene import ClientIDMutation
16-
from graphql_relay.node.node import from_global_id
17-
from graphene import ID, Boolean, Float, Int, List, String
18-
import sys
19-
2013
# Nodes
2114
class ProviderNode(DjangoObjectType):
2215
asn = Float()

netbox-graphql/dcim_schema.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import graphene
2-
from graphene import AbstractType
3-
from graphene import Node
2+
from graphene import AbstractType, Node
43
from graphene_django.filter import DjangoFilterConnectionField
54
from graphene_django.types import DjangoObjectType
6-
from dcim.models import Device, Interface, Site
75
from graphene_django.converter import convert_django_field
6+
7+
from dcim.models import Device, Interface, Site
88
from dcim.fields import ASNField, MACAddressField
9-
from .custom_filter_fields import date_types, string_types, number_types
109

1110
# Convert special field
1211
@convert_django_field.register(MACAddressField)

netbox-graphql/ipam_schema.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import graphene
2+
from graphene import AbstractType, Node
23
from graphene_django.converter import convert_django_field
3-
from graphene import AbstractType
4-
from graphene import Node
54
from graphene_django.filter import DjangoFilterConnectionField
65
from graphene_django.types import DjangoObjectType
76

87
from ipam.models import IPAddress
98
from ipam.fields import IPNetworkField, IPAddressField
10-
from .custom_filter_fields import date_types, string_types, number_types
11-
129

1310
@convert_django_field.register(IPNetworkField)
1411
def iPNetworkFieldConvert(field, registry=None):

netbox-graphql/tenancy_schema.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from graphene import AbstractType
2-
from graphene import Node
1+
from graphene import AbstractType, Node
32
from graphene_django.filter import DjangoFilterConnectionField
43
from graphene_django.types import DjangoObjectType
54
from .custom_filter_fields import date_types, string_types, number_types
@@ -23,7 +22,6 @@ class Meta:
2322
filter_fields = {
2423
'id': ['exact'],
2524
'name': string_types,
26-
# 'group__name': string_types,
2725
'description': string_types,
2826
'comments': string_types,
2927
}

0 commit comments

Comments
 (0)