lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

'unicode' object is not callable #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
My model:

import couchdb.client as couch
import couchdb.schema as couch
import datetime as datetime

class Foo(couch.Document):
    ip = couch.TextField()
    lastPolled = couch.DateTimeField(default = datetime.datetime.now())

My code:
node = Foo.Foo(ip = '67.202.38.207')
node.store(db)
return node.id()

I get the following exception:
TypeError: 'unicode' object is not callable

Any ideas?

Original issue reported on code.google.com by jst...@gmail.com on 1 Jan 2008 at 2:04

GoogleCodeExporter commented 8 years ago
First, you probably want "datetime.now" instead of "datetime.datetime.now()". 
Second, "node.ip" instead of 
"node.ip()" (no function call here!)

Please reopen if this does not fix the issue, and provide a full traceback.

Original comment by cmlenz on 15 Mar 2008 at 10:34