Ticketing App bugs

What I’m trying to do:
Im trying to build my own app based on your example ‘Ticketing App’ as a starting point.

What I’ve tried and what’s not working:
When I click on a particular ticket instance in the Tickets view (from left hand side menu) to view and possibly edit a specific ticket, I get the following error when I run a published version of the app.

TypeError: can’t compare ‘datetime’ to ‘date’. Did you initialise all data binding sources before initialising this component?

When I run the app in preview mode, the same action generates the following errors in the console:

New session: 10/11/2022, 18:30:49

Warning: Tickets.form_show does not exist. Trying to set the ‘show’ event handler of self from Tickets.

Warning: Tickets.form_refreshing_data_bindings does not exist. Trying to set the ‘refreshing_data_bindings’ event handler of self from Tickets.

Warning: Info.form_show does not exist. Trying to set the ‘show’ event handler of self from Info.

Warning: Ticket.form_show does not exist. Trying to set the ‘show’ event handler of self from Ticket. Warning: Ticket.cancel_link_click does not exist. Trying to set the ‘click’ event handler of self.cancel_link from Ticket. Warning: Ticket.save_button_click does not exist. Trying to set the ‘click’ event handler of self.save_button from Ticket.

TypeError: can't compare 'datetime' to 'date'. Did you initialise all data binding sources before initialising this component?

  • Error bindingitem of tickettoself.item:
    can't compare 'datetime' to 'date'

  • at Tickets.Ticket.Info, line 49

  • called from Tickets.Ticket.Info, line 81

  • called from Tickets.Ticket, line 39

  • called from Homepage, line 84

  • called from Tickets.Tickets.TicketList.TicketRow, line 40

This is all too disappointing for someone who needs Anvil as a reliable starting point to build simple apps and to also learn Python. Why are so many errors being generated and where do I begin unraveling? Is there a quality control check before these example apps become examples which I assume thousands of enthusiasts like me use to learn Python? Thanks.

Code Sample:

# this is a formatted code snippet.
# paste your code between ``` 

Clone link:
share a copy of your app

If you share a clone of your app, that will allow people to see exactly what’s happening. Errors in data bindings are particularly hard to tell from just error messages.

That said, the particular error you’re getting makes it sound like you’re using a datetime when something else is expecting a date, or vice versa.

Hi, this is your own Ticketing app (from your examples) that I am using. Now if I try it, it allows me to view a ticket but it does not allow me to edit the ticket via the dropdown menu. It generates similar errors. Here is the link. Anvil | Login

If you still want me to share a clone of the app, please tell me how to do it. I am a newby.

Thanks.

I’m just another user, so it’s definitely not my Ticketing app. But when I start a new app using the Ticketing App as a starting point, I don’t see the error you mention (I can view the details of a ticket without an error about datetime vs date). So to know what’s going wrong, we’ll have to see the code you’re actually running.

The docs cover how to share a clone link, complete with screenshots: Anvil Docs | Cloning Apps

Oh sorry i thought you were one of the Anvil owners / management. And thanks for showing me how to clone an app. Here’s the url. Try editing / modifying a ticket and you will see the errors. btw – unsure if this makes a difference but i am using Anvil Beta editor. Thanks for your help, friend.

https://anvil.works/build#clone:32KGKMVV5O7QZCAP=UAG7Z6YDZSMM4EZ7JMXNP5YH

I’m not seeing any TypeError in there, so I’m probably not doing the right thing. What exact steps did you use to get the TypeError?

Don’t worry about the warnings, those are harmless.

Try modifying Jess Thatcher’s ticket. You can view it by going to Tickets on the left of the screen.

See attached screenshot for error.

Thanks @rjsharma for reporting.
Moved to bug reports.
I think I’ve gone through and fixed the datetime error as well as the warning messages.
If you find anything else let us know

(You’ll need to reclone the original app to get the latest changes)

2 Likes