I had the same issue, fixed it with a variation on Jim D.'s solution.
import bookmarks
then bookmarks.models.Bookmark.objects.filter(...)
On Tuesday, October 14, 2008 11:38:20 PM UTC-7, Chris Amico wrote:
>
> I have a simple bookmarks model based on the one in James Bennett's href="http://code.
On Thu, Oct 1, 2009 at 8:47 PM, shacker wrote:
>
> Found the problem. There were no namespace problems in my template
> tag, but there were (are) in the external app I'm using, which is the
> RSS aggregator used by the djangoproject.com site itself:
>
>
> http://code.djangoproject.com/browser/dja
On Oct 1, 4:00 pm, Karen Tracey wrote:
>
> Yes, you must simply ensure you name things in such a way that the models
> module you want to access is not hidden by something else. The original
> problem noted in the thread you reference resulted from re-using the
> application's name (bookmarks) a
On Thu, Oct 1, 2009 at 6:16 PM, shacker wrote:
>
> Google apparently won't let me reply to an older thread:
>
> http://groups.google.com/group/django-users/browse_thread/thread/94239f017df4b12f
> so starting a new one.
>
> I too was hitting the "No module named models" problem when creating a
> t
Google apparently won't let me reply to an older thread:
http://groups.google.com/group/django-users/browse_thread/thread/94239f017df4b12f
so starting a new one.
I too was hitting the "No module named models" problem when creating a
template tag. I had the tag working perfectly when it communicat
On 15 oct, 09:19, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> On Wed, 2008-10-15 at 01:08 -0700, bruno desthuilliers wrote:
>
> [...]
>
> > FWIW, I just don't understand why each an every example in the
> > Django's manual insists on using this projectname.appname scheme.
>
> "Insists" is a
I came across this thread and was having the exact same problem.
*Exactly* the same... I had tried everything you tried to no avail.
I actually fixed it by taking a hint from something that came out of
following along with your debug session in my own code.
I'll put my solution in terms of your
I think it's fixed now. After much refreshing (I'm editing in Coda) a
bookmarks.pyc file appeared. Once that was gone, the tag library did
load correctly. I have a different error coming up now, which I'll try
to fix or post separately if I can't.
Thanks for the help and patience, folks.
On Oct
OK, tried all that, got pretty much the same results:
>> import bookmarks
>>> dir(bookmarks)
['__builtins__', '__doc__', '__file__', '__name__', '__path__',
'models']
>>> bookmarks.__file__
'/home/chrisamico/lib/python2.5/bookmarks/__init__.pyc'
>>> from bookmarks import templatetags
>>> dir(temp
oh well.
check that you have an __init__.py file in the templatetags directory
try this:
in bookmark_tags.py (and do keep the name that way, or later you will be
caught by this)
right before the import line throw it in into the debugger:
import pdb; pdb.set_trace()
in the debugger try:
>>> i
Tried that. Still no good. I renamed the file as bookmark_tags.py and
deleted every .pyc file in the app. Nothing in my templatetags
directory actually compiled--neither __init__.py nor bookmarks.py
(even after being renamed).
Like I said before, when I take out the import line (from
bookmarks.mo
this gets me every time.
the error is yes because the template tag is called bookmarks.py
and its inside a module called bookmarks.py
rename it to bookmarks_tags.py ...
and now
DELETE THE DAMNED OLD bookmarks.pyc file !
python is still finding the old compiled file.
its happened to me
Wish it were that easy. The app is installed, and it works everywhere
else. If I take out the {% load bookmarks %} from the template, the
rest of the app works fine. I have a view that bookmarks an object,
and it checks if a user has bookmarked that object first.
This is how I did it in the view
Seems like the problem's got to be with the "from bookmarks.models
import Bookmark" line.
The "No module named models" part of your error message suggests that
Django doesn't know about your bookmarks/models.py ... if that app is
on your Pyton path, any chance that it's just not listed in your
IN
The templatetag file is indeed called bookmarks.py. I thought of that,
tried renaming it as bookmark_tags.py, and got the same error. I'll
add that the bookmarks app lives on my python path, not in any
particular project, since I'm trying to make this as reusable as
possible.
At one point, I trie
On Oct 15, 7:38 am, Chris Amico <[EMAIL PROTECTED]> wrote:
> I have a simple bookmarks model based on the one in James Bennett's href="http://code.google.com/p/cab/source/browse/trunk/models.py?
> r=130">Cab application. I'm using a generic relation so it can
> live in its own app and a user can
On Wed, 2008-10-15 at 01:08 -0700, bruno desthuilliers wrote:
[...]
> FWIW, I just don't understand why each an every example in the
> Django's manual insists on using this projectname.appname scheme.
"Insists" is a rather strong word, since nowhere does it say "do this or
else". Also, out of al
On 15 oct, 08:45, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
(snip otherwise sound advises)
> although I would also
> recommend using full paths when importing (ie from
> projectname.bookmarks.models).
No. *Don't*. If you do so, imports will break when renaming the
directory or trying to reuse
I have a simple bookmarks model based on the one in James Bennett's http://code.google.com/p/cab/source/browse/trunk/models.py?
r=130">Cab application. I'm using a generic relation so it can
live in its own app and a user can bookmark any object on the site
(I'm planning on reusing this app on a c
19 matches
Mail list logo