<div dir="ltr"><br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
I still don't understand why you cannot use AddressSerializer just like<br>
you use DateTimeField though.  DRF serializers in general are<br>
independent from models.  The code is fine, so this is just for my<br>
personal enlightenment. :) Did you get an error?<br>
<br></blockquote><div>Yes, This is the traceback </div><div>File "/Users/Desktop/patchew/api/models.py", line 25, in <module></div><div>    from mbox import MboxMessage</div><div>  File "/Users/Desktop/patchew/mbox.py", line 17, in <module></div><div>    from api.rest import AddressSerializer</div><div>  File "/Users/Desktop/patchew/api/rest.py", line 17, in <module></div><div>    from .models import Project, Message</div><div>ImportError: cannot import name 'Project' </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
The dependency of mbox on api.rest would be very ugly, but it is easy to<br>
avoid, just move the whole class to mbox.py.<br></blockquote><div>add_db_to_rest is defined in the mbox. This makes us independent of api.rest, right?</div><div><br></div><div>Shubham </div></div></div>