Sagittarius Wizard

Learn how to use the wizard to manage your application

Running the Wizard

Warning!

Currently the Sagittarius Wizard is available only in Python source form, not as an executable or application. To run it you will need either the Python Imaging Library (PIL) or its 64-bit alternative Pillow.

Navigate to the Sagittarius-Wizard/ directory of your Sagittarius distribution and run the command python SagittariusWizard.py in your favorite command line.

Recipes

What Are Recipes?

Using the wizard revolves around the idea of RECIPES. A recipe is a collection of buttons (you can think of them as “ingredients”), each with certain attributes, that does something when submitted to your application. The following buttons are available:

Add Filter GET MODIFY DELETE

Filters restrict which objects to return based on equality. For example, an object_type==”motd” filter would only return objects whose type is “motd”.

Add Projection GET MODIFY DELETE

Projections tell the database to return only the attributes of the object that are specified. If no projections are specified, the entire object is returned (at higher cost).

Add Attribute ADD

Specifies the value of an attribute for the object to be added to the database.

Modify Attribute MODIFY

Specifies the new value of an attribute to be modified. If more than one object is being modified, all objects will take on this new value.

Set Limit GET MODIFY DELETE

Sets the maximum number of objects to operate on. If more objects exist that satisfy your query, they will be ignored.

Set Offset GET MODIFY DELETE

Sets the offset in the database to return results. This allows for pagination across multiple queries: query 1 can get objects 0-19, query 2 can get objects 20-39, and so on.

Returns Results MODIFY DELETE

By default, the MODIFY and DELETE actions do not return objects. This button tells the actions to return results, optionally with projections and limits as in a GET action.

Generic Parameter LEADERBOARDS SEND MAIL

Represents a generic URL parameter, and is used for more low-level interactions with the Sagittarius API. For example, a generic parameter with field “f” and value “v” will be encoded as &f=v.

In addition, there is a special action button automatically added to each recipe. To select the action you want your recipe to carry out, simply left-click the action button (it should be the first button in the Recipe row) and select the action from the drop-down list. The following actions are available:

Get Action

Get objects or parts of objects from the database. Which objects are returned, and how many to return, are based on the filters and limits you apply to this action.

Add Action

Add an object with the specified attributes to the database.

Modify Action

Modify certain attributes of objects from the database, optionally returning the modified objects. The objects to modify are determined by applied filters and limits.

Delete Action

Delete all objects that satisfy the applied filters and limits from the database, optionally returning them.

Leaderboards Action

Interact with the leaderboards system built into Sagittarius. Offers full support for adding/purging/removing leaderboards, posting to an existing leaderboard, and getting leaderboard data.

Send Mail Action

Send an email to the provided address through Sagittarius.

An Example Recipe

Consider the recipe below:

This is a simple recipe that queries for the current Message of the Day. The first button tells Sagittarius that it wants to GET data. The two filters make sure that all returned objects have object_type==motd and object_name==motd. Since we only want the actual message, we add a projection on the message attribute of our MOTD object. Finally, we only want one MOTD returned, so we set a limit of 1.

Adding and Deleting Buttons

Add a button to your recipe by clicking on it in the Available Buttons row. Not all buttons in the row will be clickable; whether or not you can add a button depends on the action you have selected. Once you have added a button, you can click on it in the Recipe row to modify its attributes. Doing so will bring up a dialogue of available options for that button type.

If you want to delete a button from your recipe, just right-click it. For a quick way to clear an entire recipe, go to File → Clear Recipe or press Ctrl+N. Note that you can never delete the action button.

Managing Recipes

The best part about recipes is that you can save and load them at any time. To save a new recipe, go to File → Save Recipe As… or press Alt+S and enter the name you would like to give the recipe. You can also use the quicker File → Save Recipe or Ctrl+S (if the recipe has not already been saved, you will be prompted to name it).

You can load a recipe by going to File → Load Recipe or pressing Ctrl+O. Choose the recipe you want to load from the dropdown list and press Load to load it.

A saved recipe can be deleted by going to File → Delete Recipe (for safety reasons there is no shortcut command). This will NOT clear the recipe from the Recipe row, but it will remove it from the save file. Similarly, if you clear a loaded recipe you can still save it to file; the saved recipe will be empty.

A Note on Saving

The save file for the Sagittarius Wizard is a file called recipes.dat in the same directory as SagittariusWizard.py. Avoid modifying this file. Also, this file is not written to until the wizard is closed, meaning that if the wizard should crash or be process-interrupted, you will lose any changes you have made in the current session.

Global Options

Before submitting a recipe, you must fill out the App ID and Password fields in the Global Options row. These values are the same as the values of [APP ID HERE] and [APP PASSWORD HERE] from your application’s app.yaml file. For more information, see here.

For convenience, these fields are saved every time you exit and will have their previous values the next time you run the wizard.

Understanding the Output

Coming soon!