Files
django-nepkit/todo.md
T
sankalp 8a56be0900 feat(root): release 0.2.2 with performance optimizations, bug fixes, and chore updates
- Added caching for parsed fields and normalize_address to improve admin performance.
- Fixed numerous bugs in date/time parsing, validation, and JS event handling.
2026-06-06 21:51:30 +05:45

2.4 KiB

Features TODO

Localization & Formatting

  • Nepali Currency Formatter: Template tag for formatting money using the Nepali numbering system (Lakhs, Crores).
  • Numbers to Words: Convert digits like 1234 into Nepali text (एक हजार दुई सय चौंतीस).
  • Unicode Helpers: Built-in filters for converting common text/numbers into Nepali Unicode equivalent.

Integration

  • Framework-agnostic API: Drop DRF / django-filter dependency; expose django_nepkit.api helpers usable from any view layer.

Address & Location

  • Address Normalization: Implement a way to verify or suggest standardized Nepali addresses.

Validation & Robustness (audit, v0.2.2)

  • Fix settings TOCTOU (NepkitSettings re-reads settings.NEPKIT on every access).
  • Fix XSS in _render_options.
  • format_nepali_currency end-to-end Decimal, raise on non-finite.
  • number_to_nepali_words handles negatives; raises on non-numeric.
  • BaseNepaliBSField.to_python / get_prep_value raise on bad input.
  • _parse_language_params strict mode + canonical-value whitelist.
  • _get_primary_param only falls back when there's a single non-internal param.
  • Narrow except Exception: pass in admin.py to (FieldDoesNotExist, AttributeError).
  • Log NoReverseMatch in widgets (with hint to include django_nepkit.urls).
  • strict flag on every django_nepkit.api.serialize_* / deserialize_* / to_decimal.
  • _looks_numeric rejects inf / nan / 1e1000.
  • Demo API: validate ?order=, ?year=, ?month=, ?amount_range=, ?date_range=; return 400 on bad input.
  • address-chaining.js: scope MutationObserver; suppress init-time change events; log fetch errors.
  • nepali-time-init.js: support Nepali-digit input; ship default CSS for .nepkit-time-invalid.
  • Rank location matches in _find_location_in_tokens (exact > substring).
  • Catch nepali.exceptions.FormatNotMatchException in the parsers.
  • NepaliTimeField.from_db_value (validate on read).
  • NepkitSettings.__setattr__ blocks accidental writes (read-only).

Still open / nice-to-haves

Nothing left — the perf and escaping improvements below are merged.

  • Cache parsed BaseNepaliBSField values per row in admin list views (perf).
  • Replace the format_html_join helper in _render_options with a <template>-based renderer for better escaping control.