This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express' | |
import cors from 'cors' | |
import morgan from 'morgan' | |
// import your API routes | |
const app = express() | |
const path = require('path') | |
// Get the path to your static assets somehow... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytz | |
class MyView(MyModelView): | |
# Display the time in user's local timezone on the List View | |
column_formatters = | |
dict(scheduledtime=lambda v,c,m,p: m.scheduledtime.replace(tzinfo=pytz.utc).astimezone(tz=pytz.timezone(config.LOCAL_TIMEZONE))) | |
# Display the time in user's timezone on the Edit View | |
def edit_form(self, obj): | |
form = self._edit_form_class(get_form_data(), obj=obj) |