Repository: vitalik/django-ninja (language: python)

Issue:
[BUG] `SmallAutoField` missing from `ninja.orm.fields`
**Describe the bug**
`SmallAutoField` missing from `ninja.orm.fields`
If you try to use `create_schema` on a model that has a `SmallAutoField`, you will get:
```
File "/usr/local/lib/python3.12/site-packages/ninja/orm/fields.py", line 144, in get_schema_field
    python_type = TYPES[internal_type]
                  ~~~~~^^^^^^^^^^^^^
```

**Versions (please complete the following information):**
python 3.12
django 5.0.4
ninja 1.1.0
pydantic 2.6.4




Discussion / hints:

Fix patch:
diff --git a/ninja/orm/fields.py b/ninja/orm/fields.py
index 444e8275..bbdf2c59 100644
--- a/ninja/orm/fields.py
+++ b/ninja/orm/fields.py
@@ -65,6 +65,7 @@ def validate(cls, value: Any, _: Any) -> Any:
     "PositiveIntegerField": int,
     "PositiveSmallIntegerField": int,
     "SlugField": str,
+    "SmallAutoField": int,
     "SmallIntegerField": int,
     "TextField": str,
     "TimeField": datetime.time,


Test patch:
diff --git a/tests/test_orm_schemas.py b/tests/test_orm_schemas.py
index 07df9fa1..5897fba2 100644
--- a/tests/test_orm_schemas.py
+++ b/tests/test_orm_schemas.py
@@ -191,24 +191,27 @@ class Meta:
     }
 
 
-def test_bigautofield():
-    class ModelBigAuto(models.Model):
-        bigautofiled = models.BigAutoField(primary_key=True)
+@pytest.mark.parametrize(
+    "field",
+    [
+        models.BigAutoField,
+        models.SmallAutoField,
+    ]
+)
+def test_altautofield(field: type):
+    class ModelAltAuto(models.Model):
+        altautofield = field(primary_key=True)
 
         class Meta:
             app_label = "tests"
 
-    SchemaCls = create_schema(ModelBigAuto)
+    SchemaCls = create_schema(ModelAltAuto)
     # print(SchemaCls.json_schema())
-    assert SchemaCls.json_schema() == {
-        "type": "object",
-        "properties": {
-            "bigautofiled": {
-                "anyOf": [{"type": "integer"}, {"type": "null"}],
-                "title": "Bigautofiled",
-            }
-        },
-        "title": "ModelBigAuto",
+    assert SchemaCls.json_schema()["properties"] == {
+        "altautofield": {
+            "anyOf": [{"type": "integer"}, {"type": "null"}],
+            "title": "Altautofield",
+        }
     }