Files
emailsystemv2/old/app/models/__pycache__/attachment.cpython-312.pyc

26 lines
3.5 KiB
Plaintext
Raw Normal View History

2025-02-26 18:29:10 +08:00
<EFBFBD>
g<EE92BD> <00><00>f<00>ddlmZmZmZmZmZmZddlmZddl m Z ddl
Z
ddl m Z Gd<07>de <0C>Z y) <09>)<06>Column<6D>Integer<65>String<6E>DateTime<6D>
ForeignKey<EFBFBD> LargeBinary)<01> relationship)<01>datetimeN<65>)<01>Basec<00>6<00>eZdZdZdZeed<03><04>Zeeed<05>dd<03><07>Z ee
d<08>d<06> <09>Z ee
d
<EFBFBD>d<03> <09>Z eedd <0B> <0C>Z ee
d <0A>d<03> <09>Zeed<03> <09>Zeeej&<00><0E>Zedd<02><10>Zed<11><00>Zd<12>Zdd<14>Zd<15>Zy)<17>
Attachmentu 附件模型<E6A8A1> attachmentsT)<01> primary_keyz emails.idF)<02>nullable<6C>index<65><78>)r<00>dr)r<00>defaulti<74>)r<00>Email)<01>back_populatesc<00>J<00>t|jxr |j <00>S)u*判断附件是否存储在文件系统中)<03>bool<6F> storage_path<74>content<6E><01>selfs <20>LD:\W\products\sshwork\redmineinstallssh\emailsystem\app\models\attachment.py<70>is_stored_in_fszAttachment.is_stored_in_fss!<00><00><14>D<EFBFBD>%<25>%<25>:<3A>d<EFBFBD>l<EFBFBD>l<EFBFBD>*:<3A>;<3B>;<3B>c<00>`<00>tj|d<01><02>tjj||j<00>d|j
<00>d|j <00><00><05>}t|d<04>5}|j|<01>ddd<05>||_ t|<01>|_ d|_ |S#1swY<00>)xYw)u将附件保存到文件系统T)<01>exist_ok<6F>_<>wbN) <0A>os<6F>makedirs<72>path<74>join<69>email_id<69>id<69>filename<6D>open<65>writer<00>len<65>sizer)rr<00> base_path<74> file_path<74>fs r<00>save_to_filesystemzAttachment.save_to_filesystems<><00><00> <0B> <0B> <0B>I<EFBFBD><04>-<2D><17>G<EFBFBD>G<EFBFBD>L<EFBFBD>L<EFBFBD> <15><13>}<7D>}<7D>o<EFBFBD>Q<EFBFBD>t<EFBFBD>w<EFBFBD>w<EFBFBD>i<EFBFBD>q<EFBFBD><14><1D><1D><0F> 8<>
<EFBFBD> <09> <12>)<29>T<EFBFBD> "<22>a<EFBFBD> <0A>G<EFBFBD>G<EFBFBD>G<EFBFBD> <1C>#<23>&<26><04><19><17><07>L<EFBFBD><04> <09><1B><04> <0C><18><18>#<23> "<22>s <00>*B$<03>$B-Nc<00><00>|jr |jS|jrYtjj |j<00>r0t |jd<01>5}|j <00>cddd<02>Sy#1swYyxYw)u<获取附件内容无论是从数据库还是文件系统<E7B3BB>rbN)rrr%r'<00>existsr,<00>read)r<00>attachments_dirr2s r<00> get_contentzAttachment.get_content3sd<00><00> <0F><<3C><<3C><17><<3C><<3C> <1F> <0F> <1C> <1C><12><17><17><1E><1E><04>0A<30>0A<30>!B<><15>d<EFBFBD>'<27>'<27><14>.<2E>!<21><18>v<EFBFBD>v<EFBFBD>x<EFBFBD>/<2F>.<2E><14>/<2F><14>s <00>$A?<03>?Bc<00><><00>|j|j|j|j|j|j
r|j
j <00>d<02>Sdd<02>S)u!转换为字典用于API响应N)r*r)r+<00> content_typer/<00>
created_at)r*r)r+r;r/r<<00> isoformatrs r<00>to_dictzAttachment.to_dict>sZ<00><00><17>'<27>'<27><1C> <0A> <0A><1C> <0A> <0A> <20>-<2D>-<2D><18>I<EFBFBD>I<EFBFBD>9=<3D><1F><1F>$<24>/<2F>/<2F>3<>3<>5<> 
<EFBFBD>
<EFBFBD> OS<01> 
<EFBFBD>
r )N)<1C>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F> __tablename__rrr*rr)rr+r;r/rrrrr
<00>utcnowr<r <00>email<69>propertyrr3r9r><00>r rrrs<><00><00><16>!<21>M<EFBFBD> <0F><07>T<EFBFBD> *<2A>B<EFBFBD><15>g<EFBFBD>z<EFBFBD>+<2B>6<><15>d<EFBFBD>S<>H<EFBFBD><15>f<EFBFBD>S<EFBFBD>k<EFBFBD>E<EFBFBD>2<>H<EFBFBD><19>&<26><13>+<2B><04>5<>L<EFBFBD> <11>'<27>E<EFBFBD>1<EFBFBD> 5<>D<EFBFBD><19>&<26><13>+<2B><04>5<>L<EFBFBD><14>[<5B>4<EFBFBD>0<>G<EFBFBD><17><08>(<28>/<2F>/<2F>:<3A>J<EFBFBD> <19><17><1D> ?<3F>E<EFBFBD> <0A><<3C><0E><<3C><19>, <14> 
r r)<0E>
sqlalchemyrrrrrr<00>sqlalchemy.ormr r
r%<00>r rrGr r<00><module>rKs#<00><01>Q<>Q<>'<27><1D> <09><12>?
<EFBFBD><14>?
r