add clean django-stubs folder, add some tests

This commit is contained in:
Maxim Kurnikov
2018-11-10 18:16:44 +03:00
parent 96cd3ddb27
commit a6580af216
16 changed files with 91 additions and 9 deletions

View File

View File

View File

@@ -0,0 +1 @@
from .array import ArrayField as ArrayField

View File

@@ -0,0 +1,11 @@
from typing import List, Any
from django.contrib.postgres.fields.mixins import CheckFieldDefaultMixin
from django.db.models import Field
class ArrayField(CheckFieldDefaultMixin, Field):
def __init__(self,
base_field: Field,
**kwargs): ...
def __get__(self, instance, owner) -> List[Any]: ...

View File

@@ -0,0 +1,2 @@
class CheckFieldDefaultMixin:
pass

View File

View File

@@ -0,0 +1,6 @@
from .base import Model as Model
from .fields import (AutoField as AutoField,
IntegerField as IntegerField,
CharField as CharField,
Field as Field)

View File

@@ -0,0 +1,6 @@
class ModelBase(type):
pass
class Model(metaclass=ModelBase):
pass

View File

@@ -0,0 +1,26 @@
from typing import Any
from django.db.models.query_utils import RegisterLookupMixin
class Field(RegisterLookupMixin):
def __init__(self,
primary_key: bool = False,
**kwargs): ...
def __get__(self, instance, owner) -> Any: ...
class IntegerField(Field):
def __get__(self, instance, owner) -> int: ...
class AutoField(Field):
def __get__(self, instance, owner) -> int: ...
class CharField(Field):
def __init__(self,
max_length: int,
**kwargs): ...
def __get__(self, instance, owner) -> str: ...

View File

@@ -0,0 +1,2 @@
class RegisterLookupMixin:
pass