what is the condition to decide whether is exists or not?

On Jan 20, 7:24 pm, dominatus <[email protected]> wrote:
> I have a table in one of my models that I am trying to either create
> or update based on the current date when the user logs in.  I noticed
> there is no explainable way to check if a current record exists in a
> model from within a controller function.  Do we have to use:
>
> crud.create(db.schedule) or crud.update(db.schedule,
> db.schedule((auth.user.id == db.schedule.user)) &
> (db.schedule.todays_date == datetime.date.time())).select(id)
>
> In Django there is simply a get_or_create() function to perform this
> task.  Just wondering if this is the right way of going about it.
> Thanks.

Reply via email to