This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CouchObject(object): | |
| ''' | |
| Convert between a CouchDB document and Python object. | |
| Create Python objects while maintaining a schema-free database. | |
| Define object properties without storing null fields. | |
| ''' | |
| @property | |
| def id(self): | |
| return self._id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Django: validate that an uploaded file is a valid PDF | |
| import pyPdf # from http://pybrary.net/pyPdf/ | |
| from pyPdf.utils import PdfReadError | |
| class DocumentForm(forms.ModelForm): | |
| pdf = forms.FileField() | |
| class Meta: | |
| model = Document | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Copyright (c) 2008-2009, Nathan Borror, and modified heavily by Eric Florenzano | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without modification, | |
| are permitted provided that the following conditions are met: | |
| Redistributions of source code must retain the above copyright notice, this list | |
| of conditions and the following disclaimer. | |
| Redistributions in binary form must reproduce the above copyright notice, this |
NewerOlder