You can try and use this:
def is_date(string):
try:
parse(string)
return True
except ValueError:
return False
if is_date(str(row['Created'])):
request_created_date = datetime.datetime.strftime(row['Created'], "%Y-%m-%d
%H:%M:%S")
else:
request_created_dat
awesome, worked.
On Thursday, May 29, 2014 3:41:12 PM UTC-4, Niphlod wrote:
>
> drop the table and recreate it. It's a known issue with sqlite.
>
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#SQLite
>
> On Thursday, May 29, 2014 9:34:28 PM UTC+2, Tom Russell wrote:
drop the table and recreate it. It's a known issue with sqlite.
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#SQLite
On Thursday, May 29, 2014 9:34:28 PM UTC+2, Tom Russell wrote:
>
> I am getting the following error when inserting a new record for a table I
> have.
I'm having the same problem, but I'm struggling with saving the database.
The corrupted field is a 'date' type.
On Wednesday, May 27, 2009 1:15:36 AM UTC-5, ニコノコ wrote:
>
> I found the source of my problem. I have records with null values. And
> since sqlite don't enforce data typing, I assume t
or perhaps changed a datetime to a date?
I think your problem is that you somehow have corrupted data in
database, i.e. you stored a date in a field which you later changed to
int and web2py cannot take it out any more.
On Jan 15, 8:02 pm, Andrew Evans wrote:
> Hello I just updated web2py and after restarting uwsgi I get an error on my
This is my code for that page
def index():
schedule =
db(db.schedule.date==request.now.strftime("%Y-%m-%d")).select(orderby=~db.schedule.date)
episodes = db(db.episodes.id>0).select(orderby=~db.episodes.created_on)
categories = db(db.episode_categories.id>0).select()
trailers = d
Since that seems to be settled, I want to take Annet's suggestion
beyond a slice and hear ideas about how to avoid pitfalls, and tips to
follow to steer clear of trouble while developing an app.
We can learn from each other.
--
Subscription settings: http://groups.google.com/group/web2py/subscri
On Apr 24, 1:34 pm, DenesL wrote:
> On Apr 24, 12:06 pm, Yarko Tymciurak
> wrote:
>
> > in quickly scanning this thread, I am struck by a few observations:
>
> > - it is useful for the human reading to have a hint that a variable is
> > an 'indirect" reference;
> > - the specific details - that t
I see.
Clarified!
--
Thadeus
On Sat, Apr 24, 2010 at 1:34 PM, DenesL wrote:
> he also had a 'companyapplication' table with an 'app
--
Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en
On Apr 24, 12:06 pm, Yarko Tymciurak
wrote:
> in quickly scanning this thread, I am struck by a few observations:
>
> - it is useful for the human reading to have a hint that a variable is
> an 'indirect" reference;
> - the specific details - that the inderection is by a table index
> called "id"
in quickly scanning this thread, I am struck by a few observations:
- it is useful for the human reading to have a hint that a variable is
an 'indirect" reference;
- the specific details - that the inderection is by a table index
called "id", and that it is an integer seems irrelevant (even, if at
On Apr 24, 11:06 am, Thadeus Burgess wrote:
> Since the Reference object now will query for a reference record when
> you call it, you can do things like::
What do you mean by 'now'? This has always worked for Rows.
> dogs = db().select(db.dog.ALL)
> for dog in dogs:
> dog.name
>
Since the Reference object now will query for a reference record when
you call it, you can do things like::
dogs = db().select(db.dog.ALL)
for dog in dogs:
dog.name
dog.owner.name
So the refernece column is actually called owner, insetad of owner_id.
It doesn't make sense to do
On Apr 24, 9:11 am, mdipierro wrote:
> I think there is said to say pro and con this convention.
>
> case1)
> db.define_table('person',Field('name'))
> db.define_table('dog',Field('name'),Field('owner_id',db.person)
>
> db.god.owner_id makes sense because it stores an integer but
> db.dog.owner_i
I think there is said to say pro and con this convention.
case1)
db.define_table('person',Field('name'))
db.define_table('dog',Field('name'),Field('owner_id',db.person)
db.god.owner_id makes sense because it stores an integer but
db.dog.owner_id.name is odd because 'name' is not n attribute of an
Appending '_id' to references helps to keep names different so clashes
like the one above don't happen, while at the same time they make the
program more readable for the developer, specially at a later time.
But conventions are a matter of personal preference so you can follow
whichever one you p
Hi Denes,
Thanks for providing me with an explanation of why this problem occurs
and with a solution.
> Following such a convention (adding '_id' to denote a reference) is
> highly recommended.
>From now on I will follow this convention! I don't know if I am the
only one making this mistake, if
The problem happens in this requires
IS_NOT_IN_DB(db(db.companyapplication.application==request.vars.application),db.companyapplication.company,error_message='combination
of company en application already in database')]
because the field naming choice makes it impossible to tell apart in
request
Companies in the company table can apply for one or more applications,
therefore I defined the combination table companyapplication. The
company table contains records like:
1 Butson Consultancy
2 Dreamwall
3 Preston Counselors
The application table contains records like:
1 Supplier
2
In this line:
IS_NOT_IN_DB(db(db.companyapplication.application==request.vars.application),
db.companyapplication.application is a reference field (i.e. an
integer)
request.vars.application is a string 'Supplier'. That is the problem.
Please explain in words what these table represent and what y
Massimo,
> The error refer to a field Supplier and I do not see it defined.
'Supplier is the value I enter for the Field application in the
application table.
> Some other part of the code is causing the problem and I cannot help tell
> without look at it all.
Yes, the validator defined after t
The error refer to a field Supplier and I do not see it defined. Some
other part of the code is causing the problem and I cannot help tell
without look at it all.
On Apr 20, 6:51 am, annet wrote:
> In db.py I defined the following tables:
>
> db.define_table('company',
> Field('company',lengt
23 matches
Mail list logo