A website for producing interactive charts without writing a single line of code. Built with Common Lisp and Python.
https://charts.craigoates.net
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.9 KiB
59 lines
1.9 KiB
(defpackage #:user |
|
(:use #:cl |
|
#:hot-line.db |
|
#:mito |
|
#:app-constants) |
|
;;(:import-from) |
|
(:export #:user |
|
#:seeds)) |
|
(in-package #:user) |
|
|
|
(defclass user () |
|
( |
|
;; ((id :col-type (:varchar 36) |
|
;; :primary-key t) |
|
(username |
|
:documentation "The name the user uses to log into the website." |
|
:col-type (:varchar 64) |
|
:initarg :username |
|
:accessor username-of) |
|
(display-name |
|
:documentation "The name used in the website GUI (the pretty name)." |
|
:col-type (or (:varchar 128) :null) |
|
:initarg :display-name |
|
:accessor display-name-of) |
|
(administrator |
|
:documentation "States if user has admin. priveledges. At the time |
|
of writing (21/01/2022), SQLite is the current database and it |
|
does not have a Boolean datatype so '0' represents 'false' and '1' |
|
represents 'true'. You will not come across '0' or '1' in the code |
|
because of how mito maps the code to the database. But, you will |
|
see it in the database if you view it directly." |
|
:col-type :integer |
|
:initarg :administrator |
|
:initform app-constants:+true+ ; SQLite: 0 -> false 1 -> true. |
|
:accessor is-administrator-p) |
|
(password |
|
:documentation "The user's password. It is hashed using |
|
cl-pass. The password is 'deflated' into the database. This means |
|
the password is storted as a hash and returned as the value the |
|
user provided." |
|
:col-type :text |
|
:initarg :password |
|
:accessor password-of |
|
:inflate #'cl-pass:hash |
|
;; :deflate #'cl-pass:hash |
|
) |
|
;; (created_at |
|
;; :documentation "The date the user's account was created." |
|
;; :col-type (:varchar 64) |
|
;; :initarg :created_at |
|
;; :accessor created_at) |
|
;; (updated_at |
|
;; :documentation "The last time the user logged into the website." |
|
;; :col-type (:varchar 64) |
|
;; :initarg :last-log-in |
|
;; :accessor updated_at) |
|
) |
|
(:documentation "The model used to describe the `USER' table in the database") |
|
(:metaclass mito:dao-table-class))
|
|
|