Question:
=======
After saving a record that includes a file attachment (in a FileField),
how can I open the the attached file directly from my django
application?

Problem:
======
Please, check next model.py:
from django.db import models
from django.db import models
class MaeDocs(models.Model):
    cod_doc = models.CharField('Document code', maxlength=15)
    nom_doc = models.TextField('Document name')
    doc_adj =
models.FileField(upload_to='C:/os/Django/docum/doc_uploads')
    def __str__(self):
        return (self.cod_doc + "-" + self.nom_doc[:50])
    class Admin:
        pass
class OthAttachs(models.Model):
    cod_doc = models.ForeignKey(MaeDocs, edit_inline=models.STACKED,
num_in_admin=3)
    fil_att = models.FileField(upload_to='oattach', core=True)
    def __str__(self):
        return self.fil_att
    class Admin:
        pass

First table is for saving data about a document including its main
attachment. Second table is for attaching one or more additional
documents related to the first one.

When I save a first record including main and additional attachments
and then I verify the results of the saving, all goes well; if I change
the content of some data in the MaeDocs table (nom-doc for example) and
save the changes, when verifying the record again I can see that the
secondary attachment files disappeared. Checking the History of the
record, it indicates that the secondary attachments were effectively
replaced by ' '. How can I avoid this situation?

Thanks!!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to