Bruker fileformat.write_action i Book.to_string.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
import fileformat
|
||||||
|
|
||||||
book_fields = [('title' , 'Title'), ('isbn' , 'ISBN'), ('id.id' , 'Identifier'),
|
book_fields = [('title' , 'Title'), ('isbn' , 'ISBN'), ('id.id' , 'Identifier'),
|
||||||
('subtitle' , 'Subtitle'), ('category' , 'Category'), ('publisher' , 'Publisher'),
|
('subtitle' , 'Subtitle'), ('category' , 'Category'), ('publisher' , 'Publisher'),
|
||||||
@@ -50,6 +51,7 @@ class Book(models.Model):
|
|||||||
if commit:
|
if commit:
|
||||||
# generate commit string by sending self.to_dict to oysteini function
|
# generate commit string by sending self.to_dict to oysteini function
|
||||||
print self.to_dict()
|
print self.to_dict()
|
||||||
|
print fileformat.write_action(self.to_dict())
|
||||||
|
|
||||||
else:
|
else:
|
||||||
for field in book_fields:
|
for field in book_fields:
|
||||||
|
Reference in New Issue
Block a user