Skip to content

Conversation

@jsenecal
Copy link
Collaborator

Summary

  • Make end_of_sale and end_of_support fields optional (nullable) in HardwareLifecycle model
  • Allow tracking devices that are still fully supported with no known end date
  • Add |placeholder filter to templates to display "—" for null dates

Changes

  • Model: Made end_of_sale and end_of_support nullable (blank=True, null=True)
  • Migration: 0017_optional_lifecycle_dates.py
  • Serializer: All date fields now have required=False, allow_null=True
  • Templates: Added |placeholder filter for null date display
  • Tests: Added 6 new tests for null date handling (API and forms)

Notes

PostgreSQL sorts NULLs last by default for ascending order, so devices with unknown dates will appear at the end when sorting by date.

Fixes #123

Allow creating HardwareLifecycle entries without specifying end_of_sale
and end_of_support dates. This enables tracking devices that are still
fully supported with no known end date.

- Make end_of_sale and end_of_support nullable in model
- Update API serializer with allow_null=True for all date fields
- Add comprehensive tests for null date handling (API and forms)

Fixes DanSheps#123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

End of Life, End of Support unknown capability

1 participant