[Patchew-devel] [PATCH 1/2] Text to json converter for mbox
Shubham Jain
shubhamjain7495 at gmail.com
Wed May 9 13:53:33 UTC 2018
I still don't understand why you cannot use AddressSerializer just like
> you use DateTimeField though. DRF serializers in general are
> independent from models. The code is fine, so this is just for my
> personal enlightenment. :) Did you get an error?
>
> Yes, This is the traceback
File "/Users/Desktop/patchew/api/models.py", line 25, in <module>
from mbox import MboxMessage
File "/Users/Desktop/patchew/mbox.py", line 17, in <module>
from api.rest import AddressSerializer
File "/Users/Desktop/patchew/api/rest.py", line 17, in <module>
from .models import Project, Message
ImportError: cannot import name 'Project'
> The dependency of mbox on api.rest would be very ugly, but it is easy to
> avoid, just move the whole class to mbox.py.
>
add_db_to_rest is defined in the mbox. This makes us independent of
api.rest, right?
Shubham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/patchew-devel/attachments/20180509/bc858ed8/attachment.htm>
More information about the Patchew-devel
mailing list