SarathkumarJ / snapboard

Automatically exported from code.google.com/p/snapboard
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

syncdb fails due to incorrect specification of model manager in management.py #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
snapboard revision 166 (with patches from issue 16 & 17), django revision 4934.

Original issue reported on code.google.com by johnnie....@gmail.com on 5 Apr 2007 at 11:01

GoogleCodeExporter commented 9 years ago
ok, damn.  Hit return before I completed the details.  

When running the syncdb, if fails due to the call to the Thread model's 
manager.  The
code currently calls:

Thread.objects.all().count()

But in models.py, Thread has a custom manager called view_manager.  

Attached is a patch that resolves the issue.

Original comment by johnnie....@gmail.com on 5 Apr 2007 at 11:05

Attachments:

GoogleCodeExporter commented 9 years ago
This is a problem throughout views.py. There's a call at line 177 and line 160 
that also refer to Thread.object 
instead of Thread.view_manager.

Original comment by crispywa...@gmail.com on 8 Apr 2007 at 9:23

GoogleCodeExporter commented 9 years ago
Problem caused by a Django gotcha:

Adding a custom Manager hides the original 'objects' field of a Model.  Fixed 
in rev 168.

Original comment by bs1...@gmail.com on 12 Apr 2007 at 8:56

GoogleCodeExporter commented 9 years ago
Verified in rev 168.  

Original comment by johnnie....@gmail.com on 12 Apr 2007 at 10:02