/usr/share/doc/libqdjango-doc/html/classQDjangoModel.html is in libqdjango-doc 0.4.0-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>QDjango: QDjangoModel Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">QDjango
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Properties</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-slots">Public Slots</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pro-methods">Protected Member Functions</a> |
<a href="#properties">Properties</a> |
<a href="classQDjangoModel-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">QDjangoModel Class Reference<div class="ingroups"><a class="el" href="group__Database.html">Database</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p>The <a class="el" href="classQDjangoModel.html" title="The QDjangoModel class is the base class for all models. ">QDjangoModel</a> class is the base class for all models.
<a href="classQDjangoModel.html#details">More...</a></p>
<p><code>#include <<a class="el" href="QDjangoModel_8h_source.html">QDjangoModel.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for QDjangoModel:</div>
<div class="dyncontent">
<div class="center">
<img src="classQDjangoModel.png" usemap="#QDjangoModel_map" alt=""/>
<map id="QDjangoModel_map" name="QDjangoModel_map">
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-slots"></a>
Public Slots</h2></td></tr>
<tr class="memitem:add5761ed0860fc1e4e6d2e8b3601b4ee"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classQDjangoModel.html#add5761ed0860fc1e4e6d2e8b3601b4ee">remove</a> ()</td></tr>
<tr class="separator:add5761ed0860fc1e4e6d2e8b3601b4ee"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a74616d7699ea6f0156a7ad80955a484a"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classQDjangoModel.html#a74616d7699ea6f0156a7ad80955a484a">save</a> ()</td></tr>
<tr class="separator:a74616d7699ea6f0156a7ad80955a484a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a98d5c5ea2b0dec3b7787d4ed2cfea913"><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="classQDjangoModel.html#a98d5c5ea2b0dec3b7787d4ed2cfea913">toString</a> () const </td></tr>
<tr class="separator:a98d5c5ea2b0dec3b7787d4ed2cfea913"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a17618c2c2704ca50bcb2a42af8563c75"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classQDjangoModel.html#a17618c2c2704ca50bcb2a42af8563c75">QDjangoModel</a> (QObject *parent=0)</td></tr>
<tr class="separator:a17618c2c2704ca50bcb2a42af8563c75"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7300f90b22a47a05eb4d6e7b9dafcebe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7300f90b22a47a05eb4d6e7b9dafcebe"></a>
QVariant </td><td class="memItemRight" valign="bottom"><b>pk</b> () const </td></tr>
<tr class="separator:a7300f90b22a47a05eb4d6e7b9dafcebe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a182d1bc9588e6707b31af03ef9feff25"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQDjangoModel.html#a182d1bc9588e6707b31af03ef9feff25">setPk</a> (const QVariant &<a class="el" href="classQDjangoModel.html#a4958bd5f7b02304b51d33e66684dcbb1">pk</a>)</td></tr>
<tr class="separator:a182d1bc9588e6707b31af03ef9feff25"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a3b6d25d1ed112a154d6973f230427d1f"><td class="memItemLeft" align="right" valign="top">QObject * </td><td class="memItemRight" valign="bottom"><a class="el" href="classQDjangoModel.html#a3b6d25d1ed112a154d6973f230427d1f">foreignKey</a> (const char *name) const </td></tr>
<tr class="separator:a3b6d25d1ed112a154d6973f230427d1f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a060e30783f3e08e7a2d0843c3d9e4c8f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classQDjangoModel.html#a060e30783f3e08e7a2d0843c3d9e4c8f">setForeignKey</a> (const char *name, QObject *value)</td></tr>
<tr class="separator:a060e30783f3e08e7a2d0843c3d9e4c8f"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="properties"></a>
Properties</h2></td></tr>
<tr class="memitem:a4958bd5f7b02304b51d33e66684dcbb1"><td class="memItemLeft" align="right" valign="top">QVariant </td><td class="memItemRight" valign="bottom"><a class="el" href="classQDjangoModel.html#a4958bd5f7b02304b51d33e66684dcbb1">pk</a></td></tr>
<tr class="separator:a4958bd5f7b02304b51d33e66684dcbb1"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="classQDjangoModel.html" title="The QDjangoModel class is the base class for all models. ">QDjangoModel</a> class is the base class for all models. </p>
<p>To declare your own model, create a class which inherits <a class="el" href="classQDjangoModel.html" title="The QDjangoModel class is the base class for all models. ">QDjangoModel</a> and declare the database fields as properties using the Q_PROPERTY macro. You must then register the class with <a class="el" href="classQDjango.html" title="The QDjango class provides a set of static functions. ">QDjango</a> using QDjango::registerModel().</p>
<p>You can provide options for the model using the Q_CLASSINFO macro as follows:</p>
<div class="fragment"><div class="line">Q_CLASSINFO(<span class="stringliteral">"__meta__"</span>, <span class="stringliteral">"keyword1=value1 .. keywordN=valueN"</span>)</div>
</div><!-- fragment --><p>The following keywords are recognised for model options:</p>
<ul>
<li><code>db_table</code> if provided, this is the name of the database table for the model, otherwise the lowercased class name will be used </li>
<li><code>unique_together</code> set of fields that, taken together, must be unique. If provided, a UNIQUE statement is included in the CREATE TABLE statement. Example: <code>unique_together=some_field</code>,other_field</li>
</ul>
<p>You can also provide additional information about a field using the Q_CLASSINFO macro, in the form:</p>
<div class="fragment"><div class="line">Q_CLASSINFO(<span class="stringliteral">"field_name"</span>, <span class="stringliteral">"keyword1=value1 .. keywordN=valueN"</span>)</div>
</div><!-- fragment --><p>The following keywords are recognised for field options:</p>
<ul>
<li><code>auto_increment</code> if set to 'true', and if this field is the primary key, it will be marked as auto-increment. </li>
<li><code>blank</code> if set to 'true', this field is allowed to be empty. </li>
<li><code>db_column</code> if provided, this is the name of the database column for the field, otherwise the field name will be used </li>
<li><code>db_index</code> if set to 'true', an index will be created on this field. </li>
<li><code>ignore_field</code> if set to 'true', this field will be ignored </li>
<li><code>max_length</code> the maximum length of the field (used when creating the database table) </li>
<li><code>null</code> if set to 'true', empty values will be stored as NULL. The default value is 'false'. </li>
<li><code>primary_key</code> if set to 'true', this field will be used as the primary key. If no primary key is explicitly defined, an auto-increment integer field will be added. </li>
<li><code>unique</code> if set to 'true', this field must be unique throughout the table. </li>
<li><code>on_delete</code> if provided, create a foreign key constraint on this field. Accepted values are: 'cascade', 'restrict', and 'set_null' </li>
</ul>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a17618c2c2704ca50bcb2a42af8563c75"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">QDjangoModel::QDjangoModel </td>
<td>(</td>
<td class="paramtype">QObject * </td>
<td class="paramname"><em>parent</em> = <code>0</code>)</td><td></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct a new <a class="el" href="classQDjangoModel.html" title="The QDjangoModel class is the base class for all models. ">QDjangoModel</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">parent</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a3b6d25d1ed112a154d6973f230427d1f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">QObject * QDjangoModel::foreignKey </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>name</em>)</td><td></td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the <a class="el" href="classQDjangoModel.html" title="The QDjangoModel class is the base class for all models. ">QDjangoModel</a> pointed to by the given foreign-key.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="add5761ed0860fc1e4e6d2e8b3601b4ee"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool QDjangoModel::remove </td>
<td>(</td>
<td class="paramname">)</td><td></td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Deletes the <a class="el" href="classQDjangoModel.html" title="The QDjangoModel class is the base class for all models. ">QDjangoModel</a> from the database.</p>
<dl class="section return"><dt>Returns</dt><dd>true if deletion succeeded, false otherwise </dd></dl>
</div>
</div>
<a class="anchor" id="a74616d7699ea6f0156a7ad80955a484a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool QDjangoModel::save </td>
<td>(</td>
<td class="paramname">)</td><td></td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Saves the <a class="el" href="classQDjangoModel.html" title="The QDjangoModel class is the base class for all models. ">QDjangoModel</a> to the database.</p>
<dl class="section return"><dt>Returns</dt><dd>true if saving succeeded, false otherwise </dd></dl>
</div>
</div>
<a class="anchor" id="a060e30783f3e08e7a2d0843c3d9e4c8f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void QDjangoModel::setForeignKey </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">QObject * </td>
<td class="paramname"><em>value</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the <a class="el" href="classQDjangoModel.html" title="The QDjangoModel class is the base class for all models. ">QDjangoModel</a> pointed to by the given foreign-key.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td></td></tr>
<tr><td class="paramname">value</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>The current <a class="el" href="classQDjangoModel.html" title="The QDjangoModel class is the base class for all models. ">QDjangoModel</a> will take ownership of the given <code>value</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a182d1bc9588e6707b31af03ef9feff25"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void QDjangoModel::setPk </td>
<td>(</td>
<td class="paramtype">const QVariant & </td>
<td class="paramname"><em>pk</em>)</td><td></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the primary key for this <a class="el" href="classQDjangoModel.html" title="The QDjangoModel class is the base class for all models. ">QDjangoModel</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pk</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a98d5c5ea2b0dec3b7787d4ed2cfea913"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">QString QDjangoModel::toString </td>
<td>(</td>
<td class="paramname">)</td><td></td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">slot</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a string representation of the model instance. </p>
</div>
</div>
<h2 class="groupheader">Property Documentation</h2>
<a class="anchor" id="a4958bd5f7b02304b51d33e66684dcbb1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">QVariant QDjangoModel::pk</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">read</span><span class="mlabel">write</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the primary key for this <a class="el" href="classQDjangoModel.html" title="The QDjangoModel class is the base class for all models. ">QDjangoModel</a>. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="QDjangoModel_8h_source.html">QDjangoModel.h</a></li>
<li>QDjangoModel.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jun 27 2013 13:11:51 for QDjango by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>
|