Repository: vitalik/django-ninja (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



Pull request:
Add ORM support for SmallAutoField
Fixes #1186: Adds support for a missing field and corresponding unit test.

Patch:
diff --git a/ninja/orm/fields.py b/ninja/orm/fields.py
index 444e827..bbdf2c5 100644
--- a/ninja/orm/fields.py
+++ b/ninja/orm/fields.py
@@ -65,6 +65,7 @@ TYPES = {
     "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 07df9fa..5897fba 100644
--- a/tests/test_orm_schemas.py
+++ b/tests/test_orm_schemas.py
@@ -191,24 +191,27 @@ def test_all_fields():
     }
 
 
-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",
+        }
     }