Add ValueType

This commit is contained in:
Sam Samai 2021-09-03 22:41:02 +10:00
parent 71926cfd4b
commit 4cb5bf962b
3 changed files with 19 additions and 4 deletions

View File

@ -35,6 +35,8 @@ pub enum PrimaryKey {
}
impl PrimaryKeyTrait for PrimaryKey {
type ValueType = i32;
fn auto_increment() -> bool {
true
}

View File

@ -24,5 +24,10 @@
</tbody>
</table>
<p><a href="/new">Add Post</a></p>
<div class="twelve columns">
<a href="/new">
<input type="button" value="add post" />
</a>
</div>
{% endblock content %}

View File

@ -2,7 +2,7 @@
<div class="row">
<h4>New Post</h4>
<form action="/" method="post">
<div class="ten columns">
<div class="twelve columns">
<input
type="text"
placeholder="enter title"
@ -22,8 +22,16 @@
class="u-full-width"
/>
</div>
<div class="two columns">
<input type="submit" value="add post" />
<div class="twelve columns">
<div class="two columns">
<a href="/">
<input type="button" value="cancel" />
</a>
</div>
<div class="eight columns"></div>
<div class="two columns">
<input type="submit" value="save post" />
</div>
</div>
</form>
</div>