Giter VIP home page Giter VIP logo

fsw's Introduction

FSW

FSW is a collection of tools for using Flask, SQLAlchemy, and WTForms together.

fsw's People

Contributors

bhushan-mohanraj avatar

Stargazers

 avatar

Watchers

 avatar Dheepthi Mohanraj avatar

fsw's Issues

Improve type annotations.

Since some code lacks type annotations, fill in missing annotations and use mypy (strict) for type checking.

Custom converters cannot be reached.

The current method of selecting a column converter does not allow custom converters to be used.

fsw/fsw/forms/models.py

Lines 140 to 150 in 076d071

try:
converter = cls.converters[type(column.type)]
except KeyError:
raise KeyError(
"No converter currently exists"
f" for SQLAlchemy columns of the type `{type(column.type)}`."
)
# Check whether this column has a custom converter.
if name in column_converters:
converter = column_converters[name]

Create helper functions for model and form data.

Create helper functions (in the module fsw.helpers) for loading and updating model and form data with Python dictionaries.

  • The fill function should update the attributes of instance using the dictionary values.
  • The get_model_instance_dictionary function should return a dictionary of the column values of a model instance, using the attribute names as keys.
  • The get_form_instance_dictionary function should return a dictionary of the field values of a form instance, using the attribute names as keys.

Create a delete mixin for models.

  • Create a DeleteModelMixin that adds a delete method to models, which deletes a model instance from the database.
  • Create a SoftDeleteModelMixin that adds an is_deleted boolean field or a delete_time time field to models. The delete method should set is_deleted to True or delete_time to the current time. The delete_time field could be named deleted_time or deleted_at.

Create documentation guides.

Create guides for various Flask patterns, including the following.

  • Creating a simple application with various folder structures.
  • Managing and applying database migrations with alembic.
  • Creating commands with flask and click.

Create a Jinja macro that renders form fields.

  • Create a render_fields Jinja macro that renders each field bound to a form.
  • Create similar macros for frameworks such as Bootstrap (see bhushan-mohanraj/math-club and greyli/bootstrap-flask).

Upload FSW to PyPI.

Upload FSW to PyPI. Since the fsw package is taken, upload FSW as bhushan-mohanraj-fsw.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.