4d21fd6e |
(in-package :inangulis.tables)
(eval-when (:compile-toplevel :load-toplevel :execute)
(local-time:set-local-time-cl-postgres-readers))
|
b55a8fe2 |
(defclass user ()
((id :col-type serial)
(uid :initarg :uid :col-type text)
(email :initarg :email :col-type text)
(name :initarg :name :col-type text)
(moderator :initarg :moderator :initform nil :col-type bool))
(:metaclass dao-class)
(:keys id))
(deftable user
(!dao-def))
|
4d21fd6e |
(defclass submission ()
((headline :initarg :headline :col-type text :initform "" :accessor inangulis::s-headline)
(url :initarg :url :col-type text :initform "" :accessor inangulis::s-url)
|
f6790fb4 |
(date :initarg :date :col-type timestamptz :initform "")
|
4d21fd6e |
(approved :initarg :approved :col-type text :initform "" :accessor inangulis::s-approved))
(:metaclass dao-class)
(:keys headline url))
(deftable submission
(!dao-def))
|
f6790fb4 |
;; (ubiquitous:restore :inangulis)
|
b55a8fe2 |
;; (with-connection (ubiquitous:value 'db)
;; (create-table 'user))
|
f6790fb4 |
;; (with-connection (ubiquitous:value 'db)
;; (create-table 'submission))
|
4d21fd6e |
(defmethod inangulis::s-date ((object submission))
(with-slots (date) object
(local-time:format-timestring nil date :format local-time:+rfc-1123-format+)))
(defmethod print-object ((obj submission) s)
(print-unreadable-object (obj s :type t :identity t)
(with-slots (headline url approved) obj
(format s "H: ~s U: ~s A: ~s" headline url approved))))
|