Justin:  I believe he is asking for a repo of an example Caribou site that 
does something useful (like a blog that posts comments or something).  

David:  That is right, you don't have model files which describe your 
model.  Instead, there is a Model model (with a collection of instances of 
a Field model) which is just data in the db like any other model. 
 Manipulating Model data, either through the admin or programmatically, 
modifies the schema in the background, meaning basically that there is a 
table for each Model and (roughly) a column for each Field (though there 
are more complex fields, like assets or collections, that have multiple 
fields or refer to other tables behind the scenes).  

There are many advantages to this, including being able to generate the 
admin and api automatically, (as well as letting our frontend guys add 
properties they need in a model without pestering the backend guys to make 
schema updates!).  If manipulating schemas through the admin makes you 
nervous, you can always write migrations for your model 
changes: http://caribou.github.io/caribou/docs/migrations.html

Also you can export your Models (or any data for that matter) using the 
content export/import API.  This means you can build your models using the 
admin and h2, export the schema as edn, and import it into a Postgres db. 
 Then you have a file which represents your Models that you can check into 
version control or modify directly etc.  I realize now I haven't written 
docs for this process (I'll fix that shortly), but it is in the 
caribou-core repo under src/caribou/io.clj

Part of why Caribou is alpha is that we want to make sure the automatic 
schema modification process is bulletproof, as well as solve the various 
issues that arise in migrating schemas between environments and dbs in the 
cleanest and most seamless way possible.  We have a lot of ideas and 
already things are working pretty well, but are also open to all 
suggestions on that.

The automatic schema migrations are one of the most powerful parts of 
Caribou, but also take some careful thought to ensure they are not also 
getting in the way or potentially messing things up.  In practice, we don't 
have any issues and the ability to modify the schema transparently has been 
a huge boon to the development process on teams with multiple people.  

As for field validation, that is a great idea.  Currently nothing is in 
place for ranges of numbers, but I am once again open to any suggestions. 
 I will add it to the list!

 

On Sunday, November 17, 2013 1:03:43 PM UTC-8, David Simmons wrote:
>
> Hi Ryan
>
> Congratulations on the release of Caribou. I've got a couple of questions.
>
> 1. If I create a model via the Admin UI, am I right in thinking that this 
> does not actually create a clj file containing the details of the model 
> which I could edit later via a text editor? 
> 2. Do you the concept of model validations so that a field must be numeric 
> and between 10 and 50?
>
> many thanks for you help.
>
> Dave
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to