From: <al...@us...> - 2009-04-30 02:21:40
|
Revision: 10940 http://translate.svn.sourceforge.net/translate/?rev=10940&view=rev Author: alaaosh Date: 2009-04-30 02:21:39 +0000 (Thu, 30 Apr 2009) Log Message: ----------- minor cleanup file can't be null manually setting path doesn't make sense Modified Paths: -------------- src/trunk/Pootle/local_apps/pootle_store/models.py Modified: src/trunk/Pootle/local_apps/pootle_store/models.py =================================================================== --- src/trunk/Pootle/local_apps/pootle_store/models.py 2009-04-30 02:18:59 UTC (rev 10939) +++ src/trunk/Pootle/local_apps/pootle_store/models.py 2009-04-30 02:21:39 UTC (rev 10940) @@ -24,7 +24,6 @@ from django.core.files.storage import FileSystemStorage #FIXME: move this stuff to pootle_store -from pootle_app.models.store_file import relative_real_path, absolute_real_path from pootle_app.models.directory import Directory from pootle_store.fields import TranslationStoreField @@ -37,7 +36,7 @@ """A model representing a translation store (i.e. a PO or XLIFF file).""" is_dir = False - file = TranslationStoreField(upload_to="fish", max_length=255, storage=fs, db_index=True) + file = TranslationStoreField(upload_to="fish", max_length=255, storage=fs, db_index=True, null=False) parent = models.ForeignKey(Directory, related_name='child_stores', db_index=True) pootle_path = models.CharField(max_length=255, null=False, unique=True, db_index=True) name = models.CharField(max_length=128, null=False) @@ -49,19 +48,13 @@ def _get_abs_real_path(self): return self.file.path - def _set_abs_real_path(self, value): - self.file.path = absolute_real_path(value) + abs_real_path = property(_get_abs_real_path) - abs_real_path = property(_get_abs_real_path, _set_abs_real_path) - def _get_real_path(self): return self.file.name - def _set_real_path(self, value): - self.file.name = relative_real_path(value) + real_path = property(_get_real_path) - real_path = property(_get_real_path, _set_real_path) - def __unicode__(self): return self.name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |