Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
wither
Jun 23, 2004

I have a turn both for observation and for deduction.
That's a beautiful tutorial, ATL. I look forward to this thread. If anyone's using a version past .96 however, max_length has replaced maxlength.

Adbot
ADBOT LOVES YOU

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
I am trying to extend the User model and implement django-profiles so that my users can CRUD their own accounts at will.

Update: I found the error was in AUTH_PROFILE_MODULE, I was referencing my project instead of the application that has UserProfile defined in it.

Edit: nevermind

Nolgthorn fucked around with this message at 17:40 on Mar 8, 2008

Oben
Aug 7, 2004

Oh, the lights changed
I'm hugely impressed with the admin thing. In about a day I've gone from never having touched Python to having built a whole working admin system for my site with 15 connected tables. Hopefully deploying the thing will be as easy...

qwertyasdf
Nov 11, 2003

Oben posted:

I'm hugely impressed with the admin thing. In about a day I've gone from never having touched Python to having built a whole working admin system for my site with 15 connected tables. Hopefully deploying the thing will be as easy...

Its not painful but its no party.

Sgt. Raisins
Oct 21, 2007
Damnit

ashgromnies posted:


http://www.webfaction.com/services/hosting looks like they have what I want, but I don't know if I could set up some sort of version control system on there.

edit: oooh One-click webdav and subversion repositories (over SSL)
this is getting a little off-topic though but they look like they'd be a good Django webhost :)

WebFaction is awesome. I love it, its so cheap and easy to use. They give you your own version of apache and the django support is amazing. 99% of the stuff is set up for you just with the one click installers.
I am not the only one
http://blog.awarelabs.com/?p=41

If you feel like throwing a little love my way
http://www.webfaction.com/?affiliate=apodysophilia

blorpy
Jan 5, 2005

Is there a decent guide to running this on shared hosting somewhere out there? It looks like the Django guys are just giving shared host users the finger, which is kinda mean, haha.

On my host, Django couldn't find psycopg or psycopg2 so I decided to just install python out of my /home directory. I was successful in getting python running and I've been able to then get django going on top of it. I can do django-admin.py syncdb with my project, too, and it definitely is connecting to my db ok.

The problem I'm having is I can't seem to view anything from a web browser. I've been reading the guides on using .htaccess and mysite.fcgi but can't seem to get it to work. All I get when I load the page is a blank page that takes forever to load. My logs for the subdomain it's on don't seem to indicate any errors. Are there any good guides out there on running on a shared host? I imagine I'm going to have more problems since I'm running python and everything else out of /home.

edit: Forgot to mention this is on Steadfast

blorpy fucked around with this message at 23:26 on Mar 9, 2008

king_kilr
May 25, 2007
Who is your shard host? Most of them have their own specific instructions. This thread: http://groups.google.com/group/django-users/browse_thread/thread/68c21aab73d212ff has some good info for the various shared hosts.

blorpy
Jan 5, 2005

Finally, I got it working. Looks like being on a shared host can be tricky.

blorpy fucked around with this message at 11:38 on Mar 10, 2008

ashgromnies
Jun 19, 2004
I think I'm doing something wrong... I just started with Django and got everything set up and got the administrative interface working.

My Project is named "mysite" and my App is "blog". I opened up czubus/settings.py and added "blog" to the INSTALLED_APPS array, but now I get an error:

ImproperlyConfigured: Error importing middleware django.contrib.sessions.middleware: "No module named blog"

It makes me think it's in the wrong namespace or a path is misconfigured somewhere, but I don't know where to start looking.

edit: Ahah, got it... turns out I was right - it was in the wrong namespace, so I had to put "mysite.blog" instead of just "blog" in the INSTALLED_APPS. You might want to change that in the tutorial :)

Neurozys
Apr 15, 2004

I'm still just getting my toes wet with web programming, but it looks like Ruby on Rails has some nice shortcuts for using Prototype and script.aculo.us. I've read the B-List articles about doing AJAX with Django from back in fall of '06, but it seems relatively complex. Are there any shortcuts for integrating all that 'Web 2.0' jazz on Django these days, or is it still a mostly manual process requiring a fair amount of javascript coding?

king_kilr
May 25, 2007

Neurozys posted:

I'm still just getting my toes wet with web programming, but it looks like Ruby on Rails has some nice shortcuts for using Prototype and script.aculo.us. I've read the B-List articles about doing AJAX with Django from back in fall of '06, but it seems relatively complex. Are there any shortcuts for integrating all that 'Web 2.0' jazz on Django these days, or is it still a mostly manual process requiring a fair amount of javascript coding?

Yes, Django won't write your javascript, it also doesn't lock you into using a specific toolkit, so you can use YUI, Dojo, jQuery, whatever.

hey mom its 420
May 12, 2007

ashgromnies posted:

I think I'm doing something wrong... I just started with Django and got everything set up and got the administrative interface working.

My Project is named "mysite" and my App is "blog". I opened up czubus/settings.py and added "blog" to the INSTALLED_APPS array, but now I get an error:

ImproperlyConfigured: Error importing middleware django.contrib.sessions.middleware: "No module named blog"

It makes me think it's in the wrong namespace or a path is misconfigured somewhere, but I don't know where to start looking.

edit: Ahah, got it... turns out I was right - it was in the wrong namespace, so I had to put "mysite.blog" instead of just "blog" in the INSTALLED_APPS. You might want to change that in the tutorial :)

What does your directory and file layout look like? Because adding just app_name to INSTALLED_APPS wihtout prefixing it with the site name should work, at least it works for me.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
Is there a good way of creating "HTML helpers", in the way that Rails does it, so that I could type {% paginnnnnnnnnnnator %} and have that just read from another template? Do I just need to include it on the page then and what does the code look like to do that?

What if I'm calling it multiple times in the same page, is there a way to do it properly with a minimal of code and duplication?

Can I pass arguments?

hey mom its 420
May 12, 2007

Sure, you can do all of that, take a look at this part of the documentation, it explains how it works quite nicely.

bitprophet
Jul 22, 2004
Taco Defender

Nolgthorn posted:

Is there a good way of creating "HTML helpers", in the way that Rails does it, so that I could type {% paginnnnnnnnnnnator %} and have that just read from another template? Do I just need to include it on the page then and what does the code look like to do that?

What if I'm calling it multiple times in the same page, is there a way to do it properly with a minimal of code and duplication?

Can I pass arguments?

First off, for actual custom template tags, see Bonus' link.

However, if what you want is for {% paginnnnnnnnator %} to "read from another template" then you want the built-in template tags {% include %} (for literal including) or {% block %}/{% extends %} (for a fill-in-the-holes approach).

I mean I guess you could make your own template tag that's simply a shortcut for {% include "specific/template.html" %} but I'd say that's just silly :)

ashgromnies
Jun 19, 2004

Bonus posted:

What does your directory and file layout look like? Because adding just app_name to INSTALLED_APPS wihtout prefixing it with the site name should work, at least it works for me.

code:
`-- mysite
    |-- __init__.py
    |-- __init__.pyc
    |-- blog
    |   |-- __init__.py
    |   |-- __init__.pyc
    |   |-- models.py
    |   |-- models.pyc
    |   |-- urls.py
    |   |-- urls.pyc
    |   |-- views.py
    |   `-- views.pyc
    |-- manage.py
    |-- settings.py
    |-- settings.pyc
    |-- urls.py
    `-- urls.pyc
Okay guys I am having another issue, syncdb isn't syncing the database like it should. I changed the BlogPost model to look like this:


code:
class BlogPost(models.Model):
    Title       = models.CharField(maxlength=255)
    Category    = models.ForeignKey(Category)
    Slug        = models.SlugField(prepopulate_from=('Title',))
    Author      = models.ForeignKey(User)
    PostText    = models.TextField()
    PublishDate = models.DateTimeField(auto_now_add=True)
    Featured    = models.BooleanField(default=False,help_text='Display this post on the featured area on the front page')

    def __str__(self):
        return self.Title
    class Admin:
        search_fields = ['Title', 'PostText','Category',]
        list_display = ['Title', 'Category', 'Author', 'PublishDate','Featured']
        list_filter = ['Category', 'Author', 'PublishDate','Featured']
        fields = (
            ('Details', {'fields': ('Slug','Author','PublishDate',), 'classes': 'collapse'}),
            (None, {'fields': ('Title','Category','Featured','PostText',)})
        )
    class Meta:
        pass

then ran python mysite/manage.py syncdb
code:
~/webapps/django>sdb
Loading 'initial_data' fixtures...
No fixtures found.
and then when I try accessing the admin page...
(1054, "Unknown column 'blog_blogpost.Featured' in 'field list'")

What do I need to do to get it to really sync and add that column to the table?


edit: oh, the docs!

code:
syncdb will only create tables for models which have not yet been installed. It will never issue ALTER TABLE statements to match changes made to a model class after installation.
durr

king_kilr
May 25, 2007
If you want something similar to Rails' migrations, check out django-evolution: http://code.google.com/p/django-evolution/

ATLbeer
Sep 26, 2004
Über nerd

ashgromnies posted:


Okay guys I am having another issue, syncdb isn't syncing the database like it should. I changed the BlogPost model to look like this:

What do I need to do to get it to really sync and add that column to the table?


Yeah.. Thats a knock for Django right now. Especially during rapidly changing developments. It's hard to alter schemas quickly and efficiently.

It's currently an open issue in the dev group of the Django Project - http://code.djangoproject.com/wiki/SchemaEvolution

There also is some community code contribution that helps this out a bit as well - http://code.google.com/p/django-evolution/

ashgromnies
Jun 19, 2004

ATLbeer posted:

Yeah.. Thats a knock for Django right now. Especially during rapidly changing developments. It's hard to alter schemas quickly and efficiently.

It's currently an open issue in the dev group of the Django Project - http://code.djangoproject.com/wiki/SchemaEvolution

There also is some community code contribution that helps this out a bit as well - http://code.google.com/p/django-evolution/

Ah, okay, I see. I updated my version of Django to the svn-trunk version(my hosting company gave me 0.96) and grabbed django-evolution from their repository and everything seems to work awesome now. Thanks!

Okay, now I have a weird issue with the way Django is escaping my output, I think... it didn't happen when I was running 0.96 but basically I put TinyMCE on my admin page so that I had a WYSIWYG editor for my blog posts, and it stores to the database fine, but then when I print it to the template...

code:
[b]View:[/b]
def index(request):
    featured_blog_post = BlogPost.objects.filter(Featured=True).order_by('-PublishDate')[0]
    t = loader.get_template('blog/index.html')
    c = Context({
        'featured_blog_post': featured_blog_post,
    })
    return HttpResponse(t.render(c))


[b]Template:[/b]
{% if featured_blog_post %}
<div id="featured_blog">
    <h2>Recent Blog Post<img src="/media/img/blog/brownpelican.png" alt="an adorable brown pelican"/></h2>
        <div class="post">
        <h2>{{ featured_blog_post.Title }}</h2>
        <h3>{{ featured_blog_post.PublishDate }}</h3>
        {{ featured_blog_post.PostText }}
    </div>
</div>
{% endif %}
The HTML inside the PostText doesn't get processed by the browser, it gets printed out as plain text.

For reference, here's the HTML inside the PostText...

code:
<p>hello world! <a href="http://www.google.com" target="_blank">here</a> you <strong>will see</strong> neat things. <span style="text-decoration: underline;">maybe!</span></p>

deimos
Nov 30, 2006

Forget it man this bat is whack, it's got poobrain!
After .96 all html gets escaped, you need to disable auto-escaping.
See here.

ashgromnies
Jun 19, 2004

deimos posted:

After .96 all html gets escaped, you need to disable auto-escaping.
See here.

That's the ticket! Thanks a lot.

Now to write my own custom version of the truncatewords_html filter to create a link to the full article based on its slug... I'm underway! :)

king_kilr
May 25, 2007
For anyone who's interested I've been working on building a plugin system for django. It's still a work in progress, but it should work. You can check it out here: http://github.com/alex/django-plugins/tree/master

ashgromnies
Jun 19, 2004
I've stumbled across a weird bug in Django that I can't reproduce reliably. It appears to be an error with the way it's handling regular expressions or something.

Occasionally when I enter the path http://mysite.com/admin, it redirects me to a "cannot load view page" for the view "article_detail" which is linked to in the mysite.blog urls, so I don't know how it can ever touch it.

code:
[b]mysite/urls.py[/b]
from django.conf.urls.defaults import *
from mysite.blog.urls import *

urlpatterns = patterns('',
     (r'^admin/?', include('django.contrib.admin.urls')),
     (r'^articles/', include('mysite.blog.urls')), # articles
     (r'^', include('mysite.blog.urls')), # default
)


[b]mysite/blog/urls.py[/b]
from django.conf.urls.defaults import *

urlpatterns = patterns('mysite.blog.views',
    (r'^2003/$', 'special_case_2003'),
    (r'^(\d{4})/$', 'year_archive'),
    (r'^(\d{4})/(\d{2})/$', 'month_archive'),
    (r'^(\d{4})/(\d{2})/(\d+)/$', 'article_detail'),
    (r'^', 'index') # default
)
What's weird is that is happens maybe three times every 20 tries to access /admin. I made sure that I killed all the old Django instances and restarted fresh and it still occurred.

ashgromnies fucked around with this message at 05:13 on Mar 12, 2008

king_kilr
May 25, 2007
There shouldn't be a question mark after the '/' in admin.

ashgromnies
Jun 19, 2004

king_kilr posted:

There shouldn't be a question mark after the '/' in admin.

Why not? I want the question mark to be optional. In most regular expression engines(including Python's), the question mark means to match the preceding character zero or one times.

bitprophet
Jul 22, 2004
Taco Defender

ashgromnies posted:

Why not? I want the question mark to be optional. In most regular expression engines(including Python's), the question mark means to match the preceding character zero or one times.

Make sure the slash-appending behavior of CommonMiddleware isn't screwing you up. Typically, you should have APPEND_SLASH enabled in settings.py and just forget about trying to catch 'missing' slashes in your URLconf - there's no need for doing so and it'll give rise to issues like this.

I'm guessing something unexpected is going on when interpreting your URL (again possibly caused by APPEND_SLASH behavior) and it's 'falling through' to your blogs URLconf. For example, if the admin and articles lines in your mail URLconf don't match (which seems to be what's happening) the URL dispatcher will end up in your blog URLconf (because it's catching the 'empty' regex).

At any rate, I'm 99.9% sure that if you make sure APPEND_SLASH is on (and that CommonMiddleware is enabled, natch) and remove the question mark in your admin include regex, everything will work fine, for either https://www.mysite.com/admin or https://www.mysite.com/admin/.

hey mom its 420
May 12, 2007

ashgromnies posted:

Why not? I want the question mark to be optional. In most regular expression engines(including Python's), the question mark means to match the preceding character zero or one times.

That's technically correct but I've found that it works best if you don't put the question mark after the slash and then Django will automatically append a slash if you haven't explicitly told Django not to (i.e. don't set APPEND_SLASH = False in settings.py)

edit: ugh beaten. f u bitprophet

politicorific
Sep 15, 2007
just wanted to say thank you for this awesome tutorial. Just a minor nit-pick, the path structure used changes slightly and maybe combine some of the steps to see verifiable change.

I'm sure I will be posting here with all sorts of questions in the following weeks/months

ashgromnies
Jun 19, 2004
Thanks, fellas.

I'm learning Python as I do this as well, so it's a constant struggle :)

edit: nvm i'm dumb i didn't realize the node parser part was necessary and handled wayyy deep down

ashgromnies fucked around with this message at 18:26 on Mar 12, 2008

king_kilr
May 25, 2007
Take 50 out of quotes, I'm pretty sure it is try to do this int(str("50")).

ATLbeer
Sep 26, 2004
Über nerd

king_kilr posted:

Take 50 out of quotes, I'm pretty sure it is try to do this int(str("50")).

I dunno if you posted in the right thread or not but, I'm a bit confused at what your trying to do there

"50" itself is a string. There's no reason to cast it into a string str("50") again.
- "50" == str("50") == True

To cast the string "50" into an integer (as you said 'Take 50 out of quotes') you would just int("50") the str part is redundant.

king_kilr
May 25, 2007

ATLbeer posted:

I dunno if you posted in the right thread or not but, I'm a bit confused at what your trying to do there

"50" itself is a string. There's no reason to cast it into a string str("50") again.
- "50" == str("50") == True

To cast the string "50" into an integer (as you said 'Take 50 out of quotes') you would just int("50") the str part is redundant.

ashgromnies edited his post :P . My post isn't clear, I meant str("\"50\"")

ashgromnies
Jun 19, 2004

ATLbeer posted:

I dunno if you posted in the right thread or not but, I'm a bit confused at what your trying to do there

"50" itself is a string. There's no reason to cast it into a string str("50") again.
- "50" == str("50") == True

To cast the string "50" into an integer (as you said 'Take 50 out of quotes') you would just int("50") the str part is redundant.

Yeah that wasn't even necessary. The problem was deeper down. Anyways, I have permalinks and an auto-summarize and link to full article tag now... neato!

code:
[b]models.py[/b]
class BlogPost(models.Model):
    Title       = models.CharField(max_length=255)
    Category    = models.ForeignKey(Category)
    slug        = models.SlugField(prepopulate_from=('Title',))
    Author      = models.ForeignKey(User)
    PostText    = models.TextField()
    PublishDate = models.DateTimeField(auto_now_add=True)
    Featured    = models.BooleanField(default=False,help_text='Display this post on the featured area on the front page')

    def __unicode__(self):
        return self.Title
    class Admin:
        search_fields = ['Title', 'PostText','Category',]
        list_display = ['Title', 'Category', 'Author', 'PublishDate','Featured']
        list_filter = ['Category', 'Author', 'PublishDate','Featured']
        fields = (
            ('Details', {'fields': ('slug','Author','PublishDate',), 'classes': 'collapse'}),
            (None, {'fields': ('Title','Category','Featured','PostText',)})
        )
        js = ('/media/js/tiny_mce/tiny_mce.js','/media/js/admin/textareas.js')
    class Meta:
        pass
    def get_absolute_url(self):
        y = str(self.PublishDate.year)
        m = str(self.PublishDate.month).zfill(2)
        d = str(self.PublishDate.day).zfill(2)
        s = str(self.slug)
        return ('django.views.generic.date_based.object_detail', (), {'year': y, 'month': m, 'day': d, 'slug': s})
    get_absolute_url = permalink(get_absolute_url)
code:
[b]urls.py[/b]
info_dict = {
    'queryset': BlogPost.objects.all(),
    'date_field': 'PublishDate',
    'month_format': '%m',
}

urlpatterns = patterns('',
    (r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/$', 'django.views.generic.date_based.object_detail', info_dict),
    (r'^archive$', 'django.views.generic.date_based.archive_index', info_dict),
    (r'^$', 'czubus.blog.views.index') # default
)
code:
[b]templatetags/tags.py[/b]
register = template.Library()
@register.tag(name='truncate_linkify')
def do_truncate_linkify(parser, token):
    """
    Truncates HTML after a certain number of words and
    makes the last word a link to the full article

    Argument: Number of words to truncate after.
    """
    try:
        arglist = token.split_contents()
        tag_name = arglist[0]
        value = arglist[1]
        length = arglist[2]
        link = arglist[3]
    except ValueError:
        raise template.TemplateSyntaxError, "tag requires exactly three arguments, got %r \nOR the value supplied for length was non-numeric" % token.contents.split()
    return FormatLinkifyNode(value,length,link)

from django.template import resolve_variable
class FormatLinkifyNode(template.Node):
    def __init__(self, value, length, link):
        self.value = value
        self.length = length
        self.link = link

    def render(self, context):
        from django.utils.text import truncate_html_words
        try:
            actual_value = resolve_variable(self.value, context)
            actual_link = resolve_variable(self.link, context)
            return re.sub(r'(.*)(\.{3})', r'\g<1><a href="'+actual_link+'">\g<2>(view rest of post)</a>', truncate_html_words(actual_value, self.length))
        except template.VariableDoesNotExist:
            return ''
code:
[b]index.html[/b]
{% truncate_linkify featured_blog_post.PostText 50 featured_blog_post.get_absolute_url %}
I'll probably make a writeup about this as soon as I clean up my code :)

The exception handling in tags.py is particularly stupid

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
What are you going to do in order to ensure that two of the same slugs aren't generated on the same day?

ashgromnies
Jun 19, 2004

Nolgthorn posted:

What are you going to do in order to ensure that two of the same slugs aren't generated on the same day?

Make them unique in the model, I suppose.

slug = models.SlugField(prepopulate_from=('Title',),unique=True)


However that means that the same slug can only be used once for the entire life of the application and removes the purpose of going YYYY/MM/DD/slug

I will have to think about this. I'm at work right now and can't put too much thought into it, but that's a good consideration. I need to learn more about what functionality Django models offer me.

Is there a way to make a composite key across DatePublished/Slug?

edit: haiii
http://code.djangoproject.com/wiki/MultipleColumnPrimaryKeys



Hmm. Since multiple-column primary keys aren't allowed, it seems like I could override the save method of the BlogPost model to verify that no post exists on that day with that slug before saving and otherwise throw an exception.

ashgromnies fucked around with this message at 17:06 on Mar 13, 2008

hey mom its 420
May 12, 2007

Putting a Meta inner class inside a model and assigning unique_together fields effectively achieves the same thing as composite primary keys. They're not composite primary keys in the DB, but there's an index over both of them, so effectively it's the same.

ashgromnies
Jun 19, 2004

Bonus posted:

Putting a Meta inner class inside a model and assigning unique_together fields effectively achieves the same thing as composite primary keys. They're not composite primary keys in the DB, but there's an index over both of them, so effectively it's the same.

But how can I do that since the PublishDate is a DateTimeField and I only want to compare the day, month and year and not the time?

greenskeleton
Apr 5, 2003

ashgromnies posted:

But how can I do that since the PublishDate is a DateTimeField and I only want to compare the day, month and year and not the time?

http://www.djangoproject.com/documentation/model-api/#unique-for-date

Would that be what you're looking for?

No Safe Word
Feb 26, 2005

greenskeleton posted:

http://www.djangoproject.com/documentation/model-api/#unique-for-date

Would that be what you're looking for?

Cool, I didn't even know such a thing existed, though:

django docs posted:

This is enforced at the Django admin-form level but not at the database level.

So, useful, but not db-uniqueness-assuring.

Adbot
ADBOT LOVES YOU

ashgromnies
Jun 19, 2004

greenskeleton posted:

http://www.djangoproject.com/documentation/model-api/#unique-for-date

Would that be what you're looking for?

Uhm, yes, precisely. Wow, Django is awesome. I need to reread the docs.

It's not working for me though.

I have the latest version of Django, yes.


code:
class BlogPost(models.Model):
    Title       = models.CharField(max_length=255)
    Category    = models.ForeignKey(Category)
    slug        = models.SlugField(prepopulate_from=('Title',),unique_for_date="PublishDate")
    Author      = models.ForeignKey(User)
    PostText    = models.TextField()
    PublishDate = models.DateField(auto_now_add=True)
    Featured    = models.BooleanField(default=False,help_text='Display this post on the featured area on the front page')

    def __unicode__(self):
        return self.Title
    class Admin:
        search_fields = ['Title', 'PostText','Category',]
        list_display = ['Title', 'Category', 'Author', 'PublishDate','Featured']
        list_filter = ['Category', 'Author', 'PublishDate','Featured']
        fields = (
            ('Details', {'fields': ('slug','Author','PublishDate',), 'classes': 'collapse'}),
            (None, {'fields': ('Title','Category','Featured','PostText',)})
        )
        js = ('/media/js/tiny_mce/tiny_mce.js','/media/js/admin/textareas.js')
    class Meta:
        unique_together=(('PublishDate','slug'),)
    def get_absolute_url(self):
        y = str(self.PublishDate.year)
        m = str(self.PublishDate.month).zfill(2)
        d = str(self.PublishDate.day).zfill(2)
        s = str(self.slug)
        return ('django.views.generic.date_based.object_detail', (), {'year': y, 'month': m, 'day': d, 'slug': s})
    get_absolute_url = permalink(get_absolute_url)
I dropped the table and resynced because I couldn't get the evolution thing to actually perform any evolutions... whenever something changed it'd give me an error or warning.

I created a blog post through the admin interface with slug="test-post" then created a second one with slug="test-post" and they're both in there.

ashgromnies fucked around with this message at 19:00 on Mar 13, 2008

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply