[migration] warn if 3.5 workflow migration is going to fail
.. -*- coding: utf-8 -*-=============LAX Tutorial=============Introduction------------LAX is a web framework on top of the Google AppEngine datastore.features: schema/data-model at core of app, selection/view mechanism,reuseable components, very fast developmentSince we are french, let us develop an example application that dealswith wine and will allow any wine enthusiast to track the content ofits cellar and share his tasting experiences.Schema------With LAX, the core of the application is the schema/datamodel.laxctl newapp ? XXXWe will start by something simple and define three entities: WineMaker,Wine and Bottle.:: class WineMaker(EntityType): name = String(maxsize=50, required=True) class Wine(EntityType): name = String(required=True, maxsize=100, fulltextindexed=True) vintage = Int(required=True, constraints=[IntervalBoundConstraint(1850,2100)]) grown_by = SubjectRelation('WineMaker', cardinality='?*', description=_('Winemaker who grew the wine')) class Bottle(EntityType): buy_date = Date(description=_('Date when the bottle was bought.'), default='TODAY') bottle_of = SubjectRelation('Wine', cardinality='?*')A WineMaker only has a name which is a string that is required andmust be less than 50 characters.A Wine has a name, which is a string that is required, must be lessthan 100 characters and will be indexed in the full-text index XXXfulltextindex marche pas encore. A Winealso has a vintage year which is an integer that is required and mustbe between 1850 and 2100. A Wine also has a relationship ``grown_by``that link it to a WineMaker. Cardinality ``?*`` means that a Wine canhave zero or one WineMaker (``?`` means `zero or one`) and that aWineMaker can have any number of Wine entities (``*`` means `any numberincluding zero`).A Bottle has a buy_date attribute, which is a date with a defaultvalue of TODAY, meaning that when a new bottle is created, it willhave its creation date as buy_date unless the user changes it to someother date. A Bottle also has a relationship ``bottle_of`` that linkit to a Wine. The cardinality of that relationship implies that aBottle can be linked to zero or one Wine and that a Wine can by linkedto any number of Bottle entities.Defining this simple schema is enough to get us started, launch theapplication with the command:: laxctl start Winopediaand point your browser at localhost:8080You will see the home page of your application. It lists the entitytypes: WineMaker, Wine, Bottle.Let us create a few of these. Click on the [+] at the right of thelink WineMaker. Call this new WineMaker ``Domaine du château`` andvalidate the form by clicking on ``button_ok``. Click on the logo at top left to get back to the home page, thenfollow the WineMaker link. You should be seeing a list with a singleitem ``Domaine du château``. Clicking on this item will get you to its detailed description except that in this case, there is not muchto display besides the name.Now get back to the home page by clicking on the top-left logo, thencreate a new WineMaker called ``Vallon de la Dame`` and get back to thehome page again to follow the WineMaker link for the second time. Thelist now has two items.Get back to the home page and click on [+] at the right of the linkWine. Call this new wine ``Cuvée du Roi`` and enter 2008 as vintage,then click on ``button_ok``. You added a new wine without saying whomade it. There is a box on the left entitled "actions", click on themenu item `modify`. You are back to the form to edit the wine entityyou just created, except that the form now has another section with acombobox titled "add a relationship". Chose "grown_by" in thismenu and a second combobox appears where you pick ``Domaine duchâteau``. Validate the changes by clicking ``button_ok``. The entityWine that is displayed now includes a link to the entity WineMakernamed ``Domaine du château``.Exercise~~~~~~~~Create new entities Wine and Bottle.What we learned~~~~~~~~~~~~~~~Creating a simple schema was enough to set up a new application thatcan store WineMaker, Wine, Bottle. What is next ?--------------Althought the application is fully functionnal, its look is verybasic. We will now improve how information is displayed by writingviews.Views======...Defining views with selection/viewsimplementing interfaces, calendar for bottles bought and for tasting.calendar with export icalput attribute drink_date on bottle add attribute wine colorcreate view "bottle table" with color, buy_date, drink_date.in view wine, select Wine.bottles and apply view "bottle table"demo ajax with filter on bottle tableComponents===========...customize MainTemplaterss channel of new bottles or winesuse URLRewriting for nice urlstalk about security access rightstalk about rql