[bknr-cvs] hans changed trunk/projects/quickhoney/src/

BKNR Commits bknr at bknr.net
Sat Sep 6 16:36:42 UTC 2008


Revision: 3822
Author: hans
URL: http://bknr.net/trac/changeset/3822

Update shopping data structures, not yet a lot to see here.

U   trunk/projects/quickhoney/src/packages.lisp
A   trunk/projects/quickhoney/src/quickhoney-shop.lisp
U   trunk/projects/quickhoney/src/shop.lisp

Modified: trunk/projects/quickhoney/src/packages.lisp
===================================================================
--- trunk/projects/quickhoney/src/packages.lisp	2008-09-06 16:34:27 UTC (rev 3821)
+++ trunk/projects/quickhoney/src/packages.lisp	2008-09-06 16:36:42 UTC (rev 3822)
@@ -17,6 +17,12 @@
 	:quickhoney.config)
   (:export))
 
+(defpackage :shop
+  (:use :cl
+        :bknr.datastore
+        :bknr.indices
+        :bknr.user))
+
 (defpackage :quickhoney
   (:use :cl
 	:cl-user
@@ -40,7 +46,12 @@
            #:quickhoney-image
            #:quickhoney-image-client
            #:quickhoney-image-spider-keywords
-           #:startup))
+           #:startup
+           #:quickhoney-image-category
+           #:quickhoney-image-subcategory
+           #:all-categories
+           #:subcategories-of
+           #:images-in-category))
 
 (defpackage :quickhoney.tags
   (:use :cl

Added: trunk/projects/quickhoney/src/quickhoney-shop.lisp
===================================================================
--- trunk/projects/quickhoney/src/quickhoney-shop.lisp	                        (rev 0)
+++ trunk/projects/quickhoney/src/quickhoney-shop.lisp	2008-09-06 16:36:42 UTC (rev 3822)
@@ -0,0 +1,12 @@
+(in-package :quickhoney)
+
+(define-persistent-class quickhoney-product ()
+  ((image
+    :update
+    :type (or quickhoney-image null)
+    :index-type hash-index
+    :index-reader products-for-image
+    :documentation
+    "Image that this product is related to, or nil for standalone products"))
+  (:documentation
+   "Mixin class for Quickhoney products, which are usually related to a QUICKHONEY-IMAGE"))
\ No newline at end of file

Modified: trunk/projects/quickhoney/src/shop.lisp
===================================================================
--- trunk/projects/quickhoney/src/shop.lisp	2008-09-06 16:34:27 UTC (rev 3821)
+++ trunk/projects/quickhoney/src/shop.lisp	2008-09-06 16:36:42 UTC (rev 3822)
@@ -1,4 +1,4 @@
-(in-package :quickhoney)
+(in-package :shop)
 
 ;; Shopping system.
 
@@ -24,11 +24,18 @@
     :type money
     :documentation
     "Price of the product, not including any taxes.")
-   (image
+   (name
     :update
-    :type (or quickhoney-image null)
+    :type string
+    :index-type string-unique-index
+    :index-reader product-with-name
     :documentation
-    "Image that this product is related to, or nil for standalone products")))
+    "Short name of the product, must be unique, should be identifier")
+   (description
+    :update
+    :type string
+    :documentation
+    "Textual description of the product")))
 
 (defgeneric sell (product)
   (:documentation
@@ -47,7 +54,7 @@
     address.  Once paid, the system makes the product available to the
     customer for download."))
 
-(defgeneric stock-count ((product download-product))
+(defmethod stock-count ((product download-product))
   nil)
 
 (define-persistent-class emailable-product (product)
@@ -58,12 +65,13 @@
     be supplied by the customer.  Once paid, the system sends the
     order to the store personnel for fulfillment."))
 
-(defgeneric stock-count ((product download-product))
+(defmethod stock-count ((product emailable-product))
   nil)
 
 (define-persistent-class mailable-product (product)
   ((stock-count :update
                 :type integer
+                :accessor stock-count
                 :documentation
                 "Number of instances of this product that are available to be sold."))
   (:documentation




More information about the Bknr-cvs mailing list