Forms#

The shares app provides a single user-facing form – the share creation / edit form. It is one of the per-app subclasses of BaseUserItemForm (see Forms, fields and widgets), narrowed to Share and extended with a Yahoo Finance ticker resolution check.

UserShareForm#

Concrete share variant of BaseUserItemForm. Sets item_model = Share and layers a Yahoo Finance ticker resolution check on top of the inherited duplicate / uppercase symbol validation – if the entered symbol returns no prices for the past day, the form raises a validation error rather than letting an unknown ticker reach the database.

class richy.shares.forms.UserShareForm(user, *args, **kwargs)[source]#

Bases: BaseUserItemForm

UserShareForm.clean_symbol()[source]#

Converts symbol to UPPERCASE.

Returns:

Uppercased symbol.

Return type:

str