yesod-form-0.1.0: Form handling support for Yesod Web Framework

Yesod.Helpers.Crud

Synopsis

Documentation

class Item a whereSource

An entity which can be displayed by the Crud subsite.

Methods

itemTitle :: a -> TextSource

The title of an entity, to be displayed in the list of all entities.

data Crud master item Source

Defines all of the CRUD operations (Create, Read, Update, Delete) necessary to implement this subsite. When using the Yesod.Form module and ToForm typeclass, you can probably just use defaultCrud.

Constructors

Crud 

Fields

crudSelect :: GHandler (Crud master item) master [(Key item, item)]
 
crudReplace :: Key item -> item -> GHandler (Crud master item) master ()
 
crudInsert :: item -> GHandler (Crud master item) master (Key item)
 
crudGet :: Key item -> GHandler (Crud master item) master (Maybe item)
 
crudDelete :: Key item -> GHandler (Crud master item) master ()
 

Instances

(Yesod master, Item item, SinglePiece (Key item), ToForm item master) => YesodDispatch (Crud master item) master 

defaultCrud :: (PersistEntity i, PersistBackend (YesodDB a (GGHandler (Crud a i) a IO)), YesodPersist a) => a -> Crud a iSource

A default Crud value which relies about persistent and Yesod.Form.