You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by paul jobs <we...@gmail.com> on 2008/12/21 22:56:59 UTC

constraining couchdb to reject empty docs

deleting empty invites doc acc62c8510add7d69798a6b757bc5c66 {*'count':
0,*'uid': 1379516078, 'created': '2008-12-21T13:04:00Z', '_rev':
'1796321906',
'appname': 'searchsharer',* 'invuids': [],* 'date': '2008-12-21', '_id':
'acc62c8510add7d69798a6b757bc5c66', 'name': 'Share search'}
deleting empty invites doc b76776b1b9e51871251acf343fb1a8f5 {'*count': 0*,
'uid': 1291036769, 'created': '2008-12-21T13:01:48Z', '_rev': '874951005',
'appname': 'searchsharer', *'invuids': [], *'date': '2008-12-21', '_id':
'b76776b1b9e51871251acf343fb1a8f5', 'name': 'Share search'}

is it possible to constrain couchdb to not store docs that have these
columns empty, invuids, count
if so is it done in couchdb or python?

something akin to not null in sql

thanks

Re: constraining couchdb to reject empty docs

Posted by Chris Anderson <jc...@gmail.com>.
On Mon, Dec 22, 2008 at 6:49 PM, paul jobs <we...@gmail.com> wrote:

> ;) can download n use now eh?
>

I prefer reading about it:
http://my.safaribooksonline.com/0789715368/ch01

-- 
Chris Anderson
http://jchris.mfdz.com

Re: constraining couchdb to reject empty docs

Posted by paul jobs <we...@gmail.com>.
http://gpirate.com/s?src=pop&q=Lotus%20Notes
;) can download n use now eh?

On 12/22/08, Chris Anderson <jc...@gmail.com> wrote:
>
> On Mon, Dec 22, 2008 at 6:08 PM, Andrew Tetlaw <an...@tetlaw.id.au>
> wrote:
> > Views, forms, replication... it's Lotus Notes all over again ! :)
> >
>
> Its starting to dawn on me, that there may be some relation. I never
> worked in a Lotus environment, but I do remember my dad had it at work
> when I was a kid.
>
> --
> Chris Anderson
> http://jchris.mfdz.com
>

Re: constraining couchdb to reject empty docs

Posted by Chris Anderson <jc...@gmail.com>.
On Mon, Dec 22, 2008 at 6:08 PM, Andrew Tetlaw <an...@tetlaw.id.au> wrote:
> Views, forms, replication... it's Lotus Notes all over again ! :)
>

Its starting to dawn on me, that there may be some relation. I never
worked in a Lotus environment, but I do remember my dad had it at work
when I was a kid.

-- 
Chris Anderson
http://jchris.mfdz.com

Re: constraining couchdb to reject empty docs

Posted by Andrew Tetlaw <an...@tetlaw.id.au>.
Views, forms, replication... it's Lotus Notes all over again ! :)

On 23/12/2008, at 11:34 AM, Dean Landolt wrote:
>
> see couch_tests.js for "templates" -- although I think "form" maybe a
>> better name for them.
>
>
> Why's that? From looking at couch_tests.js source I can see you're  
> using
> db/_form as the entry point. Out of curiosity, why the name form  
> rather than
> template or something else? Form just seems like such an overloaded  
> word
> (perhaps the same could be said for template as well).



--
Andrew
http://tetlaw.id.au




Re: constraining couchdb to reject empty docs

Posted by Chris Anderson <jc...@gmail.com>.
On Mon, Dec 22, 2008 at 4:34 PM, Dean Landolt <de...@deanlandolt.com> wrote:

> Sweet! Though I'm having trouble getting the tests up. All the js is loading
> alright, but no tests are appearing in the runner...

My bad. the fix is pushed. missing semicolon :(

-- 
Chris Anderson
http://jchris.mfdz.com

Re: constraining couchdb to reject empty docs

Posted by Dean Landolt <de...@deanlandolt.com>.
On Mon, Dec 22, 2008 at 6:46 PM, Chris Anderson <jc...@gmail.com> wrote:

> On Mon, Dec 22, 2008 at 3:39 PM, Dean Landolt <de...@deanlandolt.com>
> wrote:
> >
> > Any progress on the templating? Have you pushed your new main.js to a
> public
> > repo yet? I'm pretty excited to start playing around with this -- I've
> been
> > waiting for such a feature since I first read about action servers. I
> tried
> > to roll the trimpath JST stuff into main.js and generate via action
> servers
> > but was never successful. I've since done some digging and understand the
> > req object a little better so I was going to have another go, but I'm
> > probably better off waiting for this implementation.
> >
>
> Glad you asked. I just posted to github last night:
>
> http://github.com/jchris/couchdb/tree/templates
>
> ymmv, I've got the tests I've written passing, but will be writing
> more tests today. I'll try to keep github up to date and working.


Sweet! Though I'm having trouble getting the tests up. All the js is loading
alright, but no tests are appearing in the runner...

see couch_tests.js for "templates" -- although I think "form" maybe a
> better name for them.


Why's that? From looking at couch_tests.js source I can see you're using
db/_form as the entry point. Out of curiosity, why the name form rather than
template or something else? Form just seems like such an overloaded word
(perhaps the same could be said for template as well).

Re: constraining couchdb to reject empty docs

Posted by Chris Anderson <jc...@gmail.com>.
On Mon, Dec 22, 2008 at 3:39 PM, Dean Landolt <de...@deanlandolt.com> wrote:
>
> Any progress on the templating? Have you pushed your new main.js to a public
> repo yet? I'm pretty excited to start playing around with this -- I've been
> waiting for such a feature since I first read about action servers. I tried
> to roll the trimpath JST stuff into main.js and generate via action servers
> but was never successful. I've since done some digging and understand the
> req object a little better so I was going to have another go, but I'm
> probably better off waiting for this implementation.
>

Glad you asked. I just posted to github last night:

http://github.com/jchris/couchdb/tree/templates

ymmv, I've got the tests I've written passing, but will be writing
more tests today. I'll try to keep github up to date and working.

see couch_tests.js for "templates" -- although I think "form" maybe a
better name for them.


-- 
Chris Anderson
http://jchris.mfdz.com

Re: constraining couchdb to reject empty docs

Posted by Dean Landolt <de...@deanlandolt.com>.
On Sun, Dec 21, 2008 at 8:22 PM, Chris Anderson <jc...@gmail.com> wrote:

> On Sun, Dec 21, 2008 at 5:08 PM, Dean Landolt <de...@deanlandolt.com>
> wrote:
> >
> > But sweet! I'm glad this feature is under discussion. And my guess would
> you
> > would be able to choose your own templating engine, just like with a view
> > server.
> >
>
> Yes, I'm working on the implementation for main.js - it should be
> trivial to port to another language.


Any progress on the templating? Have you pushed your new main.js to a public
repo yet? I'm pretty excited to start playing around with this -- I've been
waiting for such a feature since I first read about action servers. I tried
to roll the trimpath JST stuff into main.js and generate via action servers
but was never successful. I've since done some digging and understand the
req object a little better so I was going to have another go, but I'm
probably better off waiting for this implementation.

Re: constraining couchdb to reject empty docs

Posted by Chris Anderson <jc...@gmail.com>.
On Sun, Dec 21, 2008 at 5:08 PM, Dean Landolt <de...@deanlandolt.com> wrote:
>
> But sweet! I'm glad this feature is under discussion. And my guess would you
> would be able to choose your own templating engine, just like with a view
> server.
>

Yes, I'm working on the implementation for main.js - it should be
trivial to port to another language.


-- 
Chris Anderson
http://jchris.mfdz.com

Re: constraining couchdb to reject empty docs

Posted by Dean Landolt <de...@deanlandolt.com>.
On Sun, Dec 21, 2008 at 5:34 PM, paul jobs <we...@gmail.com> wrote:

> http://jchris.mfdz.com/code/2008/12/template_functions#commentson the top
> of
> templating
> it will be cool if it can let us pick one of the templating languages
> for eg
> cheetah, mako or something like that in python
>
> On Sun, Dec 21, 2008 at 1:58 PM, Paul Davis <paul.joseph.davis@gmail.com
> >wrote:
>
> > This is what the validation stuff is for. See jchris' recent blog post.
>


I think what Paul was pointing you to was this:

http://jchris.mfdz.com/code/2008/12/couchdb_edge__security_and_vali

But sweet! I'm glad this feature is under discussion. And my guess would you
would be able to choose your own templating engine, just like with a view
server.

Re: constraining couchdb to reject empty docs

Posted by paul jobs <we...@gmail.com>.
http://jchris.mfdz.com/code/2008/12/template_functions#commentson the top of
templating
it will be cool if it can let us pick one of the templating languages
for eg
cheetah, mako or something like that in python

On Sun, Dec 21, 2008 at 1:58 PM, Paul Davis <pa...@gmail.com>wrote:

> This is what the validation stuff is for. See jchris' recent blog post.
>
> On Sun, Dec 21, 2008 at 4:56 PM, paul jobs <we...@gmail.com> wrote:
> > deleting empty invites doc acc62c8510add7d69798a6b757bc5c66 {*'count':
> > 0,*'uid': 1379516078, 'created': '2008-12-21T13:04:00Z', '_rev':
> > '1796321906',
> > 'appname': 'searchsharer',* 'invuids': [],* 'date': '2008-12-21', '_id':
> > 'acc62c8510add7d69798a6b757bc5c66', 'name': 'Share search'}
> > deleting empty invites doc b76776b1b9e51871251acf343fb1a8f5 {'*count':
> 0*,
> > 'uid': 1291036769, 'created': '2008-12-21T13:01:48Z', '_rev':
> '874951005',
> > 'appname': 'searchsharer', *'invuids': [], *'date': '2008-12-21', '_id':
> > 'b76776b1b9e51871251acf343fb1a8f5', 'name': 'Share search'}
> >
> > is it possible to constrain couchdb to not store docs that have these
> > columns empty, invuids, count
> > if so is it done in couchdb or python?
> >
> > something akin to not null in sql
> >
> > thanks
> >
>

Re: constraining couchdb to reject empty docs

Posted by paul jobs <we...@gmail.com>.
http://jchris.mfdz.com/code/2008/12/template_functions#commentsthis takes
about templates and making html out of json?

On Sun, Dec 21, 2008 at 1:58 PM, Paul Davis <pa...@gmail.com>wrote:

> This is what the validation stuff is for. See jchris' recent blog post.
>
> On Sun, Dec 21, 2008 at 4:56 PM, paul jobs <we...@gmail.com> wrote:
> > deleting empty invites doc acc62c8510add7d69798a6b757bc5c66 {*'count':
> > 0,*'uid': 1379516078, 'created': '2008-12-21T13:04:00Z', '_rev':
> > '1796321906',
> > 'appname': 'searchsharer',* 'invuids': [],* 'date': '2008-12-21', '_id':
> > 'acc62c8510add7d69798a6b757bc5c66', 'name': 'Share search'}
> > deleting empty invites doc b76776b1b9e51871251acf343fb1a8f5 {'*count':
> 0*,
> > 'uid': 1291036769, 'created': '2008-12-21T13:01:48Z', '_rev':
> '874951005',
> > 'appname': 'searchsharer', *'invuids': [], *'date': '2008-12-21', '_id':
> > 'b76776b1b9e51871251acf343fb1a8f5', 'name': 'Share search'}
> >
> > is it possible to constrain couchdb to not store docs that have these
> > columns empty, invuids, count
> > if so is it done in couchdb or python?
> >
> > something akin to not null in sql
> >
> > thanks
> >
>

Re: constraining couchdb to reject empty docs

Posted by Paul Davis <pa...@gmail.com>.
This is what the validation stuff is for. See jchris' recent blog post.

On Sun, Dec 21, 2008 at 4:56 PM, paul jobs <we...@gmail.com> wrote:
> deleting empty invites doc acc62c8510add7d69798a6b757bc5c66 {*'count':
> 0,*'uid': 1379516078, 'created': '2008-12-21T13:04:00Z', '_rev':
> '1796321906',
> 'appname': 'searchsharer',* 'invuids': [],* 'date': '2008-12-21', '_id':
> 'acc62c8510add7d69798a6b757bc5c66', 'name': 'Share search'}
> deleting empty invites doc b76776b1b9e51871251acf343fb1a8f5 {'*count': 0*,
> 'uid': 1291036769, 'created': '2008-12-21T13:01:48Z', '_rev': '874951005',
> 'appname': 'searchsharer', *'invuids': [], *'date': '2008-12-21', '_id':
> 'b76776b1b9e51871251acf343fb1a8f5', 'name': 'Share search'}
>
> is it possible to constrain couchdb to not store docs that have these
> columns empty, invuids, count
> if so is it done in couchdb or python?
>
> something akin to not null in sql
>
> thanks
>