File: tour.html

package info (click to toggle)
sqlkit 0.9.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,184 kB
  • sloc: python: 17,477; sql: 166; makefile: 95; xml: 23; sh: 11
file content (545 lines) | stat: -rw-r--r-- 27,102 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      
      <title>
    Sqlkit &amp; Sqledit
 &mdash; sqlkit v0.9.5 documentation</title>
      
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/sqlkit.css" type="text/css" />
    <link rel="stylesheet" href="../_static/print.css" type="text/css" media="print" />

    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="top" title="sqlkit v0.9.5 documentation" href="../index.html" />
        <link rel="up" title="Mailing list" href="tutorials.html" />
        <link rel="prev" title="Sqledit - the standalone program to browse and edit data" href="sqledit.html" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
          URL_ROOT:    '../',
          VERSION:     '0.9.5',
          COLLAPSE_MODINDEX: false,
          FILE_SUFFIX: '.html'
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>


<!-- <link rel="stylesheet" href="http://www.myjqueryplugins.com/plugins/jmenu/demo/jquery/jMenu.jquery.css" type="text/css" /> -->
      <link rel="stylesheet" href="../_static/jMenu.jquery.css" type="text/css" />
      <script type="text/javascript" src="http://www.myjqueryplugins.com/plugins/jmenu/demo/jquery/jquery.js"></script>
      <script type="text/javascript" src="http://www.myjqueryplugins.com/plugins/jmenu/demo/jquery/jquery-ui.js"></script>

      <!-- <script type="text/javascript" src="http://www.myjqueryplugins.com/plugins/jmenu/demo/jquery/jMenu.jquery.js"></script> -->

      <script type="text/javascript">

	var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-18221996-2']);
	_gaq.push(['_trackPageview']);

	(function() {
	  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	})();

      </script>
      <script type="text/javascript" src="../_static/jMenu.jquery.js"></script>
      <script type="text/javascript">
	      $(document).ready(function(){
		      $("#jMenu").jMenu({
			      ulWidth : '150',
			      effects : {
				      effectSpeedOpen : 300,
				      effectSpeedClose : 300,
				      effectTypeOpen : 'slide',
				      effectTypeClose : 'slide',
				      effectOpen : 'linear',
				      effectClose : 'linear'
			      },
			      TimeBeforeOpening : 100,
			      TimeBeforeClosing : 400,
			      animatedText : false,
			      paddingLeft: 1		});
	      })
      </script>
<!-- Preview -->
     <script type="text/javascript" src="../_static/imgpreview.js"></script>
     <script type="text/javascript">
       $(document).ready(function(){
           $('.preview').imgPreview();
       });
     </script>
     
    <link rel="stylesheet" href="../_static/tour.css" type="text/css" media="screen" />
    

     <!--[if !IE 7]>
	     <style type="text/css">
		     #wrap {display:table;height:100%}
	     </style>
     <![endif]-->
    </head>
    <body>
        




<div id="wrap">
    
<div id="header">

	<div class="logo"><a href="#">
       <img src="../_static/sqlkit.png" align="left"  alt="Logo" border="0"/></a>
        </div>
	<div id="description">Acces to db made easy</div>
</div>


   <div style="clear:left;"></div>


<div >
	<ul id="jMenu">
            <li><a class="fNiv" href="../index.html" title="Home" 
                  >Home</a></li>

            <li><a li class="fNiv" href="../sqlkit/contents.html"
                  title="Sqlkit - the python package" 
                  >Sqlkit</a>

	       <ul>
		 <li ><a href="../sqlkit/contents.html"
		       title="Sqlkit - the python package" 
		       >Sqlkit</a></li>

		 <li ><a href="../sqlkit/sqlwidget.html" title="Widgets" 
		       >Widgets</a>
		       <ul> 
			 <li ><a href="../sqlkit/mask.html" title="Mask" 
			       >Mask view</a></li>
			 <li ><a href="../sqlkit/table.html" title="Table" 
			       >Table view</a></li>
		       </ul>
                 </li>
		 <li ><a href="../sqlkit/browsing.html" title="Browsing Data" 
		       >Browsing data</a>
		    <ul> 
		      <li ><a href="../sqlkit/constraints.html" title="Constraints" 
			    >Constraints</a></li>
		      <li ><a href="../sqlkit/filters.html" title="Filters" 
			    >Filters</a></li>
		      <li ><a href="../sqlkit/totals.html" title="Totals" 
			    >Totals</a></li>
		    </ul>
                 </li>
		 <li ><a href="../sqlkit/editing.html" title="Editing Data" 
		       >Editing data</a>
			 <ul> 
			   <li ><a href="../sqlkit/completion.html" title="Completion" 
				 >Completion</a></li>
			   <li ><a href="../sqlkit/validation.html" title="Validation" 
				 >Validation</a></li>
			   <li ><a href="../sqlkit/relationship.html" title="Relationships" 
				 >Relationships</a></li>
			 </ul>
		       </li>
		 <li ><a href="../sqlkit/printing.html" title="Printing" 
		       ><span>Printing</span></a></li>
		 <li ><a href="../sqlkit/advanced/contents.html" title="Advanced configuration" 
		       >Advanced configuration</a>
			 <ul> 
			   <li ><a href="../sqlkit/advanced/fields.html" title="Fields" 
				 >Fields</a></li>
			   <li ><a href="../sqlkit/advanced/views.html" title="Views" 
				 >Views</a></li>
			 </ul>
		       </li>

	       </ul>
            </li>

            <li><a class="fNiv" href="sqledit.html"
                  title="Sqledit GUI" 
                  >Sqledit GUI</a></li>

            <li><a class="fNiv" href="tutorials.html"
                  title="Support & tutorials" 
                  >Support & Tutorials</a>
	       <ul>
		 <li ><a href="sqledit.html"
		       title="Sqledit - the application" 
		       >Sqledit - the application</a></li>
		 <li ><a href="#"
		       title="Sqlkit - the features'tour"
		       >Sqlkit - features' tour</a></li>
		 <li ><a href="sqledit.html"
		       title="Sqledit - the application" 
		       >Installing instructions</a></li>
		</ul> 
            </li>

            <li><a class="fNiv" href="../layout/contents.html" title="Layout"
                  >Layout</a></li>

            <li><a  class="fNiv"href="contents.html" title="Download" 
                  >Download</a>

	       <ul>
		 <li ><a href="contents.html"
		       title="Download"
		       >Download</a></li>
		 <li ><a href="http://sqlkit.argolinux.org/download/Changelog"  title="Changelog"
		       title="Changelog"
		       >Changelog</a></li>
		 <li ><a href="backward_incompatibilities.html"
		       title="Backward incompatibilities"
		       >Backward incompatibilities</a></li>
	       </ul>
            </li>



        </ul>
</div>
   <div style="clear:left;"></div>

    
    <div class="related">
      <ul>
	

      </ul>

    </div>

    

  <div class="sphinxsidebar">
     <div class="sphinxsidebarwrapper">
      <div class="news">

      <h2>Release 0.9.5 is out</h2>
      
      I'm happy to announce that on February, 7 2012 I released 
      <a href="download.html#download">version 0.9.5</a> of
	sqlkit that adds support for sqlalchemy 0.7+ as wel as some minor
        improvements (see
	<a href="/download/Changelog">changelog</a>). 
	
     </div>
     </div>

   </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">

            <div class="body">
                









<div class="section" id="sqlkit-sqledit">
<h1>Sqlkit &amp; Sqledit<a class="headerlink" href="#sqlkit-sqledit" title="Permalink to this headline">¶</a></h1>
<p>Sqlkit is a tool to edit <strong>data</strong> of a database (as opposed to schemas) in the
easiest possible way. By <strong>easy</strong> we mean both: easy to write for the <em>user</em>
since completion helps you, and easy to write for the <em>programmer</em> as a lot of
features are there to help you customize it. It&#8217;s based on <a class="reference external" href="http://www.pygtk.org">PyGTK</a>.</p>
<p>It provides:</p>
<ul class="simple">
<li>a GUI named <a class="reference external" href="sqledit.html#sqledit"><em>sqledit</em></a> that can be used standalone and does
not require programming knowledge</li>
<li>a Python package that mainly provides two megawidgets: <a class="reference external" href="../sqlkit/mask.html#mask"><em>SqlMask</em></a> and
<a class="reference external" href="../sqlkit/table.html#table"><em>SqlTable</em></a>, very powerful classes to build your application.</li>
</ul>
<p>A typical usage can be:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">sqlkit.widgets</span> <span class="kn">import</span> <span class="n">SqlTable</span><span class="p">,</span> <span class="n">SqlMask</span>
<span class="kn">from</span> <span class="nn">sqlkit</span> <span class="kn">import</span> <span class="n">DbProxy</span>

<span class="n">db</span> <span class="o">=</span> <span class="n">DbProxy</span><span class="p">(</span><span class="n">engine</span><span class="o">=</span><span class="s">&#39;sqlite:///movies.sqlite&#39;</span><span class="p">)</span>
<span class="n">t</span> <span class="o">=</span> <span class="n">SqlMask</span><span class="p">(</span><span class="s">&#39;movie&#39;</span><span class="p">,</span> <span class="n">dbproxy</span><span class="o">=</span><span class="n">db</span><span class="p">,</span> <span class="n">single</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
</pre></div>
</div>
<p>that will pop up an editor for the record. Filter panel will be available
just clicking on the label of the fields.</p>
<div class="section" id="features">
<span id="sqlkit"></span><h2>Features<a class="headerlink" href="#features" title="Permalink to this headline">¶</a></h2>
<p><strong>Main features of sqlkit</strong>:</p>
<ul class="simple">
<li>Editor of databases in 2 modes: <a class="reference external" href="../sqlkit/table.html#table"><em>SqlTable</em></a> &amp; <a class="reference external" href="../sqlkit/mask.html#mask"><em>SqlMask</em></a>. Mask can
embed tables of <a class="reference external" href="../sqlkit/relationship.html#relationships"><em>related tables</em></a>.</li>
<li>Based on <a class="reference external" href="http://www.sqlalchemy.org">sqlalchemy</a>: can cope with many different database backends
(PostgreSQL, MySQL, sqlite and firebird the ones sqlkit was tested
on).  Can be used to edit any  selectable you can build with sqlalchemy.</li>
<li>Very powerful <a class="reference external" href="../sqlkit/filters.html#filters"><em>filtering</em></a> capabilities:<ul>
<li>each field can be used to filter visible records</li>
<li>date filtering possible also on relative basis (good for saved
queries)</li>
<li>works on expressions too</li>
<li>works on fields in <a class="reference external" href="../sqlkit/relationship.html#relationships"><em>related tables</em></a> embedded in mask</li>
</ul>
</li>
<li><a class="reference external" href="../sqlkit/completion.html#completion"><em>Completion</em></a> both on normal fields and foreign key fields</li>
<li>Very easy way to draw a layout for mask views</li>
<li><a class="reference external" href="sqledit.html#sqledit"><em>Sqledit - the standalone program to browse and edit data</em></a>: python script to edit db</li>
<li>Completely effortless editing of <a class="reference external" href="../sqlkit/relationship.html#relationships"><em>Relationships</em></a></li>
<li>Very easy way to set <a class="reference external" href="../sqlkit/defaults.html#defaults"><em>Defaults</em></a></li>
<li>Possibility to display <a class="reference external" href="../sqlkit/totals.html#totals"><em>Totals</em></a> in numeric fields</li>
<li><a class="reference external" href="../sqlkit/constraints.html#constraints"><em>Constraints</em></a>: any possible sql constraint can be attached to a Mask
or a Table. It can be expressed as a normal sqlalchemy query or with
django-like syntax. Works on expressions too.</li>
<li>SqlMask and SqlTable are widgets with several <a class="reference external" href="../sqlkit/sqlwidget.html#signals"><em>Signals</em></a></li>
<li><a class="reference external" href="../sqlkit/sqlwidget.html#hooks"><em>Hooks</em></a> for a very easy customization of behavior and for validation</li>
<li>More than 70 snippets of code to demonstrate each feature</li>
</ul>
<a class="preview reference external image-reference" href="../_images/table-demo.png"><img align="right" alt="table opened on movies" class="preview align-right" src="../_images/table-demo.png" style="width: 334.5px; height: 193.0px;" /></a>
<div class="section" id="table">
<h3>Table<a class="headerlink" href="#table" title="Permalink to this headline">¶</a></h3>
<p>You can see data in a tabular format using the <a class="reference external" href="../sqlkit/table.html#table"><em>SqlTable</em></a> widget.</p>
<p>The code is as simple as:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">t</span> <span class="o">=</span> <span class="n">SqlTable</span><span class="p">(</span><span class="s">&#39;movie&#39;</span><span class="p">,</span> <span class="n">dbproxy</span><span class="o">=</span><span class="n">db</span><span class="p">,</span> <span class="p">)</span>
</pre></div>
</div>
<p>you can customize which columns to show, possible filters or constraints
(see below), and a lot of others details</p>
</div>
<div class="section" id="mask">
<h3>Mask<a class="headerlink" href="#mask" title="Permalink to this headline">¶</a></h3>
<a class="preview reference external image-reference" href="../_images/mask-demo.png"><img align="right" alt="../_images/mask-demo.png" class="preview align-right" src="../_images/mask-demo.png" style="width: 286.0px; height: 157.0px;" /></a>
<p>Records can be displayed one record at a time with the SqlMask widget.
Tables can be embedded in mask to edit <a class="reference external" href="../sqlkit/relationship.html#relationships"><em>Relationships</em></a>.</p>
<p>that where requested by the following instructions:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">lay</span> <span class="o">=</span> <span class="s">&quot;&quot;&quot;</span>
<span class="s">   varchar10</span>
<span class="s">   varchar200  - - -</span>
<span class="s">   {N  { %time</span>
<span class="s">         {&gt;&gt;.general</span>

<span class="s">            date        interval</span>
<span class="s">            datetime    time</span>
<span class="s">            }</span>
<span class="s">         {&gt;.hidden_boolean</span>
<span class="s">            bool    bool_null</span>
<span class="s">         }</span>
<span class="s">        }</span>
<span class="s">      {  %numbers</span>
<span class="s">         integer</span>
<span class="s">         float</span>
<span class="s">         numeric</span>
<span class="s">      }</span>
<span class="s">      {  %text</span>
<span class="s">         text</span>
<span class="s">         uni_text</span>
<span class="s">       }</span>
<span class="s">       } - - -</span>


<span class="s">&quot;&quot;&quot;</span>
<span class="n">t1</span> <span class="o">=</span> <span class="n">SqlMask</span><span class="p">(</span><span class="s">&#39;all_types&#39;</span><span class="p">,</span> <span class="n">dbproxy</span><span class="o">=</span><span class="n">db</span><span class="p">,</span> <span class="n">layout</span><span class="o">=</span><span class="n">layout</span><span class="p">,</span> <span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="filters">
<h3>Filters<a class="headerlink" href="#filters" title="Permalink to this headline">¶</a></h3>
<a class="preview reference external image-reference" href="../_images/filter-panel.png"><img align="right" alt="../_images/filter-panel.png" class="preview align-right" src="../_images/filter-panel.png" style="width: 212.0px; height: 107.5px;" /></a>
<p>Each label of both views can be clicked to get a <a class="reference external" href="../sqlkit/filters.html#filters"><em>filter panel</em></a> through which we can choose an operator and filter records. Filter
let you use a &#8220;human&#8221; representation of foreign keys, that means that if
<tt class="docutils literal"><span class="pre">director_id</span></tt> points to a numeric id, sqlkit will let you write the (last)
name of the director instead when filtering.</p>
<p>The filter panel will let you navigate in the output list, that can be
completely customized.</p>
</div>
<div class="section" id="completion">
<h3>Completion<a class="headerlink" href="#completion" title="Permalink to this headline">¶</a></h3>
<p><a class="reference external" href="../sqlkit/completion.html#completion"><em>Completion</em></a> is triggered by F1 key, Ctrl-Enter or Shift-Enter.  If the
field is a foreign key it will pop up a list of foreign values otherwise it
will show values currently used (just for varchar fields).</p>
<p>The search for completion is done using the (possibly) already written
letters as filter: Control will match them at the beginning of the field,
Shift (and F1) will match them in any part. The search is made using
<tt class="docutils literal"><span class="pre">LIKE</span></tt> operators or <tt class="docutils literal"><span class="pre">regexp</span></tt> according to whatever is available in the
db engine in use.</p>
</div>
<div class="section" id="layout">
<h3>Layout<a class="headerlink" href="#layout" title="Permalink to this headline">¶</a></h3>
<p>Very easy way to draw a layout. See <a class="reference external" href="../layout/layout.html#layout"><em>A GUI description language - purpose</em></a> widgets for a tour.
The language used relates to glade as a markup language relates to html.</p>
<p>This GUI description language lets you draw a layout using field_name as
place holders for the widget that you will use to edit it:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">title</span>
<span class="n">director_id</span>
</pre></div>
</div>
<p>will be replaced by a label &#8216;title&#8217; followed by an entry and a title
&#8216;director_id&#8217; followed by a widget suitable to edit a foreign key.</p>
<p>Le language gets more complicated to let you use main gtk widgets as frames,
notebooks, scrollable widgets, tables....</p>
</div>
<div class="section" id="relationships">
<h3>Relationships<a class="headerlink" href="#relationships" title="Permalink to this headline">¶</a></h3>
<a class="preview reference external image-reference" href="../_images/o2m.png"><img align="right" alt="../_images/o2m.png" class="preview align-right" src="../_images/o2m.png" style="width: 250.0px; height: 138.5px;" /></a>
<p>This is probably the most impressive feature.</p>
<p>You can build a layout in which related data are displayed in a totally
natural way. The following layout requires the code:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">lay</span> <span class="o">=</span> <span class="s">&quot;&quot;&quot;</span>
<span class="s">   first_name</span>
<span class="s">   last_name</span>
<span class="s">   nation</span>
<span class="s">   o2m=movies:title,description,year,date_release</span>
<span class="s">&quot;&quot;&quot;</span>
<span class="n">SqlMask</span><span class="p">(</span><span class="n">Movie</span><span class="p">,</span> <span class="n">layout</span><span class="o">=</span><span class="n">lay</span><span class="p">,</span> <span class="n">dbproxy</span><span class="o">=</span><span class="n">db</span><span class="p">)</span>
</pre></div>
</div>
<p>now you can edit director and films. The demo has plenty of working examples
for there cases:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">many2one:</th><td class="field-body">are just recognized automatically with simple introspection</td>
</tr>
<tr class="field"><th class="field-name">many2many:</th><td class="field-body">is very simply added to SqlMask declaring in the layout and
attribute with that name</td>
</tr>
<tr class="field"><th class="field-name">one2many:</th><td class="field-body">same as many2many</td>
</tr>
</tbody>
</table>
<p>Many more detail in <a class="reference external" href="../sqlkit/relationship.html#relationships"><em>Relationships</em></a></p>
<a class="preview reference external image-reference" href="../_images/totals-embedded.png"><img align="right" alt="../_images/totals-embedded.png" class="preview align-right" src="../_images/totals-embedded.png" style="width: 225.2px; height: 152.8px;" /></a>
</div>
<div class="section" id="totals">
<h3>Totals<a class="headerlink" href="#totals" title="Permalink to this headline">¶</a></h3>
<p>It&#8217;s possible to display totals and subtotals in a table view.
In this picture you can see how a table embedded into a mask can display
totals.</p>
<p>More in <a class="reference external" href="../sqlkit/totals.html#totals"><em>Totals</em></a></p>
</div>
<div class="section" id="constraints">
<h3>Constraints<a class="headerlink" href="#constraints" title="Permalink to this headline">¶</a></h3>
<p>A <a class="reference external" href="../sqlkit/constraints.html#constraints"><em>constraint</em></a> can be as simple as:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">t</span> <span class="o">=</span> <span class="n">SqlTable</span><span class="p">(</span><span class="s">&#39;movie&#39;</span><span class="p">,</span> <span class="n">dbproxy</span><span class="o">=</span><span class="n">db</span><span class="p">)</span>
<span class="n">t</span><span class="o">.</span><span class="n">add_constraints</span><span class="p">(</span><span class="n">actors__country</span><span class="o">=</span><span class="s">&#39;ITA&#39;</span><span class="p">,</span> <span class="n">genres__name</span><span class="o">=</span><span class="s">&#39;drama&#39;</span><span class="p">,</span>
  <span class="n">year__gte</span><span class="o">=</span><span class="mi">1950</span><span class="p">,</span> <span class="n">year__lte</span><span class="o">=</span><span class="mi">1970</span><span class="p">)</span>
</pre></div>
</div>
<p>And browsing of movies will be constrained into dramas with at least one
italian actor, produced between 1950 and 1970. The double underscore &#8216;__&#8217;
will allow spanning from one table to a related (provided a relation was
established at sqlalchemy level) and from attribute name to operator to e
used.</p>
</div>
<div class="section" id="sqledit">
<h3>Sqledit<a class="headerlink" href="#sqledit" title="Permalink to this headline">¶</a></h3>
<p>A full featured program (python script) that can browse a database. Many
options (<tt class="docutils literal"><span class="pre">sqledit</span> <span class="pre">-h</span></tt>).</p>
<a class="preview reference external image-reference" href="../_images/sqledit.png"><img align="right" alt="../_images/sqledit.png" class="preview align-right" src="../_images/sqledit.png" style="width: 133.5px; height: 219.0px;" /></a>
<p>Just try it out on your preferred database using the url in a form as one
of the examples:</p>
<div class="highlight-python"><pre>sqledit postgres://localhost/mydb
sqledit postgres://sandro:passwd@host:5444/mydb
sqledit mysql://localhost/mydb
sqledit sqlite:///movies.sqlite</pre>
</div>
<p>the last is a very minimal db present in <tt class="docutils literal"><span class="pre">doc/db/movies.sqlite</span></tt></p>
</div>
</div>
<div class="section" id="basic-assumptions-and-limitations">
<span id="basic-limitations"></span><h2>Basic assumptions and limitations<a class="headerlink" href="#basic-assumptions-and-limitations" title="Permalink to this headline">¶</a></h2>
<ol class="arabic">
<li><p class="first">You use PrimaryKeys and ForeignKeys throughout the db.
If you don&#8217;t use ForeignKeys sqlkit will just work w/o any special
behavior. If you don&#8217;t use PrimaryKeys sqlkit will not even open the
table.</p>
</li>
<li><p class="first">ForeignKeys are <em>simple</em>. Compound ForeignKeys are not yet supported,
that means that you can&#8217;t use:</p>
<div class="highlight-python"><pre>class MyTable(Base):
   ...
   ForeignKeyConstraint('first_field, second_field], [referenced1, referenced2])</pre>
</div>
<p>This will be addressed in a future release</p>
</li>
<li><p class="first">You are using one single metadata. This is a limit but it&#8217;s my normal
environment. There&#8217;s not really anything that cannot be changed easily
about this, simply I didn&#8217;t have need for this, nor working cases.  (While
I was plenty of ideas on other features...)</p>
</li>
<li><p class="first">Spaces are not allowed in field names. This comes from the layout syntax
definition.</p>
</li>
</ol>
</div>
<div class="section" id="foreignkeys">
<span id="fkey"></span><h2>ForeignKeys<a class="headerlink" href="#foreignkeys" title="Permalink to this headline">¶</a></h2>
<p>Everywhere there&#8217;s a ForeignKey I try to represent it in
the best possible way. More info in the completion chapter:
<a class="reference external" href="../sqlkit/completion.html#description"><em>foreign key description &amp; search field</em></a></p>
</div>
<div class="section" id="sqlkit-supported-backends">
<h2>sqlkit supported backends<a class="headerlink" href="#sqlkit-supported-backends" title="Permalink to this headline">¶</a></h2>
<p>Sqlkit is built on sqlalchemy that allows editing db with many <a class="reference external" href="http://www.sqlalchemy.org/trac/wiki/DatabaseNotes">different
engines</a>. I use it with PostgreSQL, MySQL, sqlite and Firebird.  Other
engines are supported but may need a very simple addition that I&#8217;d be
willing to do on demand.</p>
</div>
</div>



            </div>
        </div>
     </div>
   </div>

        
</div> <!-- wrap -->

            <div class="bottomnav footer">
                <div class="doc_copyright">
                Alessandro Dentella -- Copyright 2006-2007-2008-2009-2010
		  Sqlkit release 0.9.5
<!--                 % if hasdoc('copyright'): -->
<!--                     &copy; <a href="../copyright.html">Copyright</a> 2008, Sandro Dentella. -->
<!--                 % else: -->
<!--                     &copy; Copyright 2008, Sandro Dentella. -->
<!--                 % endif -->
                    creato usando  <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
                </div>
            </div>
        












<br style="clear: left" />

    </body>
</html>