Compare commits
No commits in common. "master" and "v0.12.0" have entirely different histories.
5 changed files with 4 additions and 52 deletions
|
|
@ -5,12 +5,6 @@ All notable changes to WuttaFarm will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## v0.12.1 (2026-05-31)
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
|
|
||||||
- allow null for `Quantity.measure` field
|
|
||||||
|
|
||||||
## v0.12.0 (2026-05-30)
|
## v0.12.0 (2026-05-30)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "WuttaFarm"
|
name = "WuttaFarm"
|
||||||
version = "0.12.1"
|
version = "0.12.0"
|
||||||
description = "Web app to integrate with and extend farmOS"
|
description = "Web app to integrate with and extend farmOS"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [
|
authors = [
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
"""allow null for quantity.measure_id
|
|
||||||
|
|
||||||
Revision ID: c30a725b54f9
|
|
||||||
Revises: a240a1449de9
|
|
||||||
Create Date: 2026-05-30 22:14:21.056993
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
from typing import Sequence, Union
|
|
||||||
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
|
||||||
import wuttjamaican.db.util
|
|
||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
|
||||||
revision: str = "c30a725b54f9"
|
|
||||||
down_revision: Union[str, None] = "a240a1449de9"
|
|
||||||
branch_labels: Union[str, Sequence[str], None] = None
|
|
||||||
depends_on: Union[str, Sequence[str], None] = None
|
|
||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
|
||||||
|
|
||||||
# quantity
|
|
||||||
op.alter_column(
|
|
||||||
"quantity", "measure_id", existing_type=sa.VARCHAR(length=20), nullable=True
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
|
||||||
|
|
||||||
# quantity
|
|
||||||
op.alter_column(
|
|
||||||
"quantity", "measure_id", existing_type=sa.VARCHAR(length=20), nullable=False
|
|
||||||
)
|
|
||||||
|
|
@ -109,7 +109,7 @@ class Quantity(model.Base):
|
||||||
measure_id = sa.Column(
|
measure_id = sa.Column(
|
||||||
sa.String(length=20),
|
sa.String(length=20),
|
||||||
sa.ForeignKey("measure.drupal_id"),
|
sa.ForeignKey("measure.drupal_id"),
|
||||||
nullable=True,
|
nullable=False,
|
||||||
doc="""
|
doc="""
|
||||||
Measure for the quantity.
|
Measure for the quantity.
|
||||||
""",
|
""",
|
||||||
|
|
@ -192,12 +192,7 @@ class Quantity(model.Base):
|
||||||
app = config.get_app()
|
app = config.get_app()
|
||||||
value = app.render_quantity(value)
|
value = app.render_quantity(value)
|
||||||
units = str(self.units or "")
|
units = str(self.units or "")
|
||||||
|
return f"( {measure} ) {value} {units}"
|
||||||
if measure:
|
|
||||||
return f"( {measure} ) {value} {units}"
|
|
||||||
|
|
||||||
label = self.label or ""
|
|
||||||
return f"{label} {value} {units}"
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.render_as_text()
|
return self.render_as_text()
|
||||||
|
|
|
||||||
|
|
@ -298,8 +298,7 @@ class QuantityMasterView(WuttaFarmMasterView):
|
||||||
f.remove("measure")
|
f.remove("measure")
|
||||||
else:
|
else:
|
||||||
f.set_readonly("measure")
|
f.set_readonly("measure")
|
||||||
if quantity.measure:
|
f.set_default("measure", quantity.measure.name)
|
||||||
f.set_default("measure", quantity.measure.name)
|
|
||||||
|
|
||||||
# value
|
# value
|
||||||
if self.creating:
|
if self.creating:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue