pgvector / pgvector-python

pgvector support for Python
MIT License
951 stars 63 forks source link

Django support for empty fields #67

Closed Cdingram closed 5 months ago

Cdingram commented 5 months ago

In Django it would be very useful to be able to use null=True and/or blank=True as is common for model fields so that the vector can be calculated after the object is created for example. Currently doing this creates an error "vector must have at least 1 dimension".

ankane commented 5 months ago

Hi @Cdingram, it already supports this.

Cdingram commented 5 months ago

You're right, my apologies. For whatever reason, it's not possible to save it as blank via the django admin dashboard. It seems like for whatever reason the form there tries to default blank to '[]'. That is the actual issue, although I'm not sure if that issue is possible to fix here or upstream.

Cdingram commented 5 months ago

Fixed in PR #68