I tried what you asked, and found no errors when importing, but errors
when I tried to use the imported class.  It seems as though it finds
'coltrane', but can't find the models in the app.  Here is the
result:

python
Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import coltrane
>>> from coltrane import *
>>> c = coltrane.Category()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Category'
>>> c = Category()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Category' is not defined
>>>

Here is the class in my models.py file.  I should also note that this
code WORKED with syncdb at first, then starting failing later:

import datetime

from django.db import models
from django.contrib.auth import User

from markdown import markdown
from tagging.fields import TagField

class Category(models.Model):
    title = models.CharField(max_length=250,
                             help_text='Maximum 250 characters.')
    slug = models.SlugField(unique=True,
                            help_text="Suggested automatically from
the title. Must be unique.")
    description = models.TextField()

    class Meta:
        ordering = ['title']
        verbose_name_plural = "Categories"

    def __unicode__(self):
        return self.title

    def get_absolute_url(self):
        return "/categories/%s" % self.slug


Thank you again for your help!
Matthew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to