Re: Multiple sites - same code, different templates

2008-12-13 Thread barbara shaurette
This might be overkill, but you could use middleware and parse for the version number in request.path: from django.conf import settings from django.http import HttpResponseRedirect from mysite import settings as local_settings class DetectSiteVersion(object): def __init__(self): sel

Re: Request object from models

2008-11-21 Thread barbara shaurette
Yeah, you want to assign that user_id value in the view, when you're saving the instance: mydocument.author_id = request.user.id mydocument.save() Are you trying to solve for a case where you want the current *admin* user to be the author_id for the record? You can also add a save metho

Re: Admin page: How to add a column for user that added an item

2008-10-29 Thread barbara shaurette
You need a save_model() method in your corresponding admin class: def save_model(self, request, obj, form, change): obj.user = request.user obj.save() http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-methods --~--~-~--~~~---~--~

Re: Spliting a single result from a db

2008-10-22 Thread barbara shaurette
If you do decide to split up the text, it would be worthwhile getting to know some of the built-in template filters: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#truncatewords Playing around with filters like truncatewords, wordcount, and wordwrap might give you some ideas. --~-

Re: Is there a way to generate an API doc from docstrings?

2008-10-15 Thread barbara shaurette
Ah, thank you - admindocs is probably all I need, if not I'll take a look at epydoc. :) On Oct 15, 4:25 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Wed, Oct 15, 2008 at 4:52 PM, barbara shaurette <[EMAIL PROTECTED]> wrote: > > I could swear that, pre

Is there a way to generate an API doc from docstrings?

2008-10-15 Thread barbara shaurette
I could swear that, pre 1.0 release, I came across a page on auto- generating documentation from docstrings, but I can't find it in the Django documentation anymore. Did a module that did that ever exist? Or am I crazy? Wait, don't answer that. I've also seen some old references to docstrings

Re: Custom middleware: using process_view to modify the view_func

2008-10-10 Thread barbara shaurette
:) Thanks for this - it does seem simple in retrospect, but I've been banging my head against the same problem too. On Sep 17, 11:53 am, intrepidweb <[EMAIL PROTECTED]> wrote: > FYI, I answered my own question. It's pretty simple, actually. If you > want process_view() to override the view_func()

Re: Multiple projects, model inheritance, and one common database

2008-10-09 Thread barbara shaurette
*bump* Seriously - anyone have any ideas? On Oct 8, 11:46 am, barbara shaurette <[EMAIL PROTECTED]> wrote: > Actually, that's been suggested ... and considered.  The problem is > that these two initial projects aren't going to be the only ones. > There will be more

Re: Multiple projects, model inheritance, and one common database

2008-10-08 Thread barbara shaurette
atabase is, alas, just not scalable. On Oct 8, 11:21 am, Carl Meyer <[EMAIL PROTECTED]> wrote: > On Oct 8, 12:47 pm, barbara shaurette <[EMAIL PROTECTED]> wrote: > > > We're building a couple of different projects - one social network-y > > site, and one that

Multiple projects, model inheritance, and one common database

2008-10-08 Thread barbara shaurette
We're building a couple of different projects - one social network-y site, and one that's bloglike. So each has its own unique database, but they do share one common set of content. I've created a third "common" project to hold the base models, at least - the model inheritance seems to be workin

Re: Changing field error messages

2008-09-23 Thread barbara shaurette
Question 1: What are you using in your template to display the errors? Question 2: Did you start working on this app on Talk Like a Pirate Day? On Sep 23, 3:13 am, Donn <[EMAIL PROTECTED]> wrote: > On Tuesday, 23 September 2008 11:42:19 Daniel Roseman wrote:> The __all__ > error messages are a

Re: invalid literal for int() with base 10 trying to access uploaded image

2008-09-19 Thread barbara shaurette
Try logging out your SQL and look for any suspicious INSERTs - I've run across this error a few times, under different circumstances, always because my code is trying to insert a string when the column is expecting an integer. --~--~-~--~~~---~--~~ You received this

Re: When to start an app?

2008-09-13 Thread barbara shaurette
Yep, you'll have some overlap, but I think it makes sense to create a separate app wherever the data model/views could logically stand alone. So, user registration would be one app. I'm working on a project that does a lot with demographic data based on user profiles, so profiles is another sep