Browse Source

Documentation fixes

Rafał Pitoń 11 years ago
parent
commit
86b4630f03
2 changed files with 18 additions and 4 deletions
  1. 3 3
      docs/developers/thread_store.rst
  2. 15 1
      docs/developers/validators.rst

+ 3 - 3
docs/developers/thread_store.rst

@@ -8,7 +8,7 @@ Thread store lives in :py:mod:`misago.core.threadstore` and offers subset of sta
 
 
 get
----
+===
 
 .. function:: get(key, default=None)
 
@@ -26,7 +26,7 @@ get() never raises an exception for non-existant value which is why you should a
 
 
 set
----
+===
 
 .. function:: set(key, value)
 
@@ -34,7 +34,7 @@ Set value for a key on thread store. This value will then be stored until you ov
 
 
 clear
------
+=====
 
 .. function:: clear()
 

+ 15 - 1
docs/developers/validators.rst

@@ -2,4 +2,18 @@
 Misago Validators
 =================
 
-Misago apps implement plenty of validators, wich so
+Misago apps implement plenty of validators, someof which are considered public API. Those validators are documented here.
+
+
+validate_sluggable
+==================
+
+:py:class:`misago.core.validators.validate_sluggable`
+
+Callable class that validates if string can be converted to non-empty slug thats no longer than 255 characters.
+
+To you use it, first instantiate it. If you want to define custom error messages, you can pass them using ``error_short`` and ``error_long`` arguments on initializer. After that you can simply call the class like other validator functions to see if it raises ``ValidationError``::
+
+    from misago.core.validators import validate_sluggable
+    validator = validate_sluggable()
+    validator(some_value)