Re: Django Cheat Sheet

2007-02-13 Thread Rob Hudson
> Not really. Anything you can do to a tuple (which is, basically, > iterate over it, slice it and access specific items out of it) you can > also do to a list. A tuple is just a little bit more efficient when > you know you're dealing with something that isn't/shouldn't be > mutable. Actually, I

Re: Django Cheat Sheet

2007-02-13 Thread Rob Hudson
Very cool. I agree with another poster, adding FK and M2M and their options would be a nice addition if there is room. Minor nit... It says for version 0.95 yet there is a single template filter with footnote "In development version only." It seems like you might as well remove that. This also

Re: Filtering foreign items in admin

2007-02-10 Thread Rob Hudson
Take a look at "limit_choices_to" in the model api docs and see if that will do what you need. On Feb 9, 4:27 am, "Rob Slotboom" <[EMAIL PROTECTED]> wrote: > For a several models I use a FK to photos. The drop down in admin to > choose from lists all photos. > Can this list be filtered so I can r

Re: problem with flatpages and debug=false

2007-02-05 Thread Rob Hudson
This is a known bug: http://code.djangoproject.com/ticket/3335 On Feb 5, 8:53 am, patrickk <[EMAIL PROTECTED]> wrote: > when I go to one of the flatpages on our site (not admin), I´m > getting "404 page not found" - but only when debug=False. > with debug=True, everything´s fine. > > any ideas? >

Re: Where to put function to instantiate and save a model object?

2007-02-03 Thread Rob Hudson
Russell Keith-Magee wrote: > Look in django.contrib.auth.models for UserManager for implementation details. Nice. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Django as Single Sign-On?

2007-02-02 Thread Rob Hudson
On Fri Feb 02, 2007 at 02:11:22PM -0800, Reinhard Knobelspies wrote: > > Kim Camerons "Laws of Identity" should be your starting point for > research on SSO and identity-related matters: > http://www.identityblog.com/?page_id=354 > > Django and OpenID > http://simonwillison.net/2006/Dec/22/scree

Re: Django as Single Sign-On?

2007-02-02 Thread Rob Hudson
On Fri Feb 02, 2007 at 09:51:33PM -, Brian Beck wrote: > Hi Rob, > > I implemented CAS in Django, which is one form of single sign-on. > You're welcome to check out the code to see what needs to be done for > such a task; it's mostly middleware stuff. Details are here: http:// > blog.case.edu

Django as Single Sign-On?

2007-02-02 Thread Rob Hudson
I confess I haven't done my research on what actually constitutes SSO and what underlying functionality has to exist, but I think we're looking at a possible need for something like this so I thought I'd open up a discussion... Could Django be used to implement Single Sign-On? I plan to read thi

Where to put function to instantiate and save a model object?

2007-02-02 Thread Rob Hudson
I have a model called "Log" which logs access to certain pages or sets variables that we're tracking. The way I'm inserting new records into the log table is like this: Log(user=request.user, session=request.session.session_key, varname='somename').save() But I'm finding that I'm writing th

Re: currently online users?

2007-01-23 Thread Rob Hudson
I don't have an answer but some thoughts... 1) last_login isn't on by default. That's actually an unasked question I've had -- are there examples that show this working? 2) last_login would presumably be set only on login, not on every request. So this wouldn't be the field to use for this any

Re: dump and restore tool for django

2007-01-23 Thread Rob Hudson
Russell Keith-Magee wrote: > Glad you like it. I'm hoping to get some time in the next week or so > to finish off the few things that are needed before I bug Adrian for > permission to commit. In the meantime, if you have any suggestions or > comments, let me know. Maybe I could just throw in ano

Re: How to set "REMEMBER ME"

2007-01-22 Thread Rob Hudson
It would be interesting to know, however, how to make this work like this: Default case: when the user doesn't check the "remember me" box... - Remove the cookie on browser close. This is great for sites that might get used in public places like libraries. - You can do this with: settings.SESSIO

Re: dump and restore tool for django

2007-01-22 Thread Rob Hudson
I've looked at the dump code in #2333 and I'm looking forward to this being added. I brought up a question before about being able to dump data in a database agnostic way. It's interesting how you simply use the serializers. And JSON for data is an interesting choice too. It looks like it work

Re: login and redirect_to

2007-01-19 Thread Rob Hudson
How would one set next from a view with the code i showed above? I think I understand what you're asking. If you sent next as a hidden variable in your template, you get read it by calling: request.REQUEST.get as seen here: http://code.djangoproject.com/browser/django/trunk/django/contrib/aut

Re: settings.ADMINS and error emails?

2007-01-18 Thread Rob Hudson
Rob Hudson wrote: What else needs to be set here? I found my own answer. I need to set this so my picky-against-spam Postfix config will let these through: File: conf/default_settings.py... # E-mail address that error messages come from. SERVER_EMAIL = '[EMAIL PROTECTED]&#

Re: settings.ADMINS and error emails?

2007-01-18 Thread Rob Hudson
Hmmm. I'm seeing a fully-qualified domain name error in my Postfix logs b/c Django is sending as [EMAIL PROTECTED] Even though I do have DEFAULT_FROM_EMAIL set and password resets are working correctly. What else needs to be set here? Or is this a Postfix problem on my end? --~--~-~

Re: login and redirect_to

2007-01-18 Thread Rob Hudson
IIRC, that gets set based on what is in the login form's hidden field named "next". REDIRECT_FIELD_NAME is in django.contrib.auth and is set to "next" by default. You can override it in the template like this: This will always redirect to the root of the site "/". If that value is empty,

settings.ADMINS and error emails?

2007-01-18 Thread Rob Hudson
I've read that setting ADMINS will send emails on errors. I'm guessing like for 404s or 500s. But I've never seen any error messages come to me even though I do get errors occasionally. How can I set up Django to email me the traceback or simply an error message when it encounters a 500 Intern

Re: Database offline message?

2007-01-18 Thread Rob Hudson
A "MAINTENANCE_MODE" sounds good. Thanks for the suggestion! --~--~-~--~~~---~--~~ 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

Re: Common problem? Grouping date based objects by year?

2007-01-17 Thread Rob Hudson
I made some minor changes and it worked. I didn't realize you can do this with dates and regroup... {% regroup nlist by date_posted|date:"Y" as grouped %} {% for group in grouped %} {{ group.grouper }} {% for item in group.list %} {{ item.date_posted|date:"F Y" }} {% endfor %} {% endfor %}

Re: Django Signals?

2007-01-17 Thread Rob Hudson
Cool. I was mainly concerned that it might not be officially documented for a reason. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-user

Django Signals?

2007-01-17 Thread Rob Hudson
What's up with Django signals? They seem to be an undocumented feature, though one I think is handy. $ grep -i signals django/docs/* returns nothing. Googling for "signals site:djangobook.com" comes up empty. I did find a reference in the wiki... http://code.djangoproject.com/wiki/Signals Plu

Re: Common problem? Grouping date based objects by year?

2007-01-17 Thread Rob Hudson
There is no key "year" so I didn't think that would work. I'll give it a try tomorrow just to be sure, though. Thanks, Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Database offline message?

2007-01-17 Thread Rob Hudson
Is there a way to detect that the database is offline and provide a message (to all URLs), something like, "The database is down for upgrades. Check back in about an hour." Of course it's easy enough to drop in a temp urls.py to reroute all to the same view with a simple output message, but I w

Common problem? Grouping date based objects by year?

2007-01-17 Thread Rob Hudson
Here's the problem. I have a list of newsletters that I want to group by year. My view is simply getting them all in reverse date order. How do you properly handle the HTML output for this? I have this, which is broken in that it opens and closes a UL tag with nothing in it... {% if news_l

Re: What svn (subversion) client do you use for OS X?

2007-01-12 Thread Rob Hudson
If you visit their "Documents & Files" section you can see there have been some updates as recent as December 2006. But they sound experimental. But it looks like progress is being made... Noah wrote: > I could hope there is a rewrite... after all there hasn't been a news > update since 2004...

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread Rob Hudson
There's also SCPlugin which is going through a re-write at the moment. You might have some success with their old version, however. http://scplugin.tigris.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djan

Re: Problem setting up a separate media server

2007-01-06 Thread Rob Hudson
what about defining images in your stylesheets? The way we solve that is that if you reference your CSS with src="{{ media_url }}/css/style.css" and have urls in that CSS, define your urls with relative addressing and they'll also come from the media server. For us, we have a directory struct

Re: What if slug is already used?

2006-12-21 Thread Rob Hudson
* SmileyChris ([EMAIL PROTECTED]) wrote: When faced with a similar situation, I overwrote the save method and ensured the slug generated is unique (adding _2 or _3 etc to the end if it wasn't). Can you explain how to do this? This is the approach I was going to take. When you call save() on

What if slug is already used?

2006-12-20 Thread Rob Hudson
I have an object that has a title. I'd like to use the title to pre-populate a slug field for use in URLs so I can have descriptive URLs. Instead of: /myobject/(?P\d+)/ I want: /myobject/(?P[-\w]+)/ I'm concerned if the user types in a title that's already taken. Slug fields get a db_index=Tr

Re: Converting a Django site to flat HTML

2006-12-06 Thread Rob Hudson
Here's the wget flags I'm using to do something similar: wget -E --load-cookies /path/to/firefox/profiles/cookies.txt -r -k -l inf -N -p -E = use .html as extension -r = recurse -k = convert links -l inf = infinite depth -N = disable timestamping? -p = get page requisites Other than that, I als

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-12-01 Thread Rob Hudson
Thanks for the reply, Russell. It's obviously a lot more complex and detailed than simply adding a min() where count() is. :) A couple thoughts... > 4 - If you search the archives (user and developer), you will find several > discussions on aggregate functions. group_by() and having() (or > pr

Re: offtopic: delete *.pyc from subversion

2006-11-29 Thread Rob Hudson
patrick k. wrote: > when I do "svn diff" the pyc-files are still listed. > guess I have to delete that files from the repository first. right? Yes, I guess I should have said "And tell subversion to ignore them." Once you set Subversion to ignore *.pyc, they won't be added anymore. But if you cu

Re: offtopic: delete *.pyc from subversion

2006-11-29 Thread Rob Hudson
Or tell Subversion to ignore them. You should have a file: ~/.subversion/config (on Mac or Linux, not sure where it is on Windows) In that file under the header "[miscellany]" there's a "global-ignores" setting. Just add *.pyc to that list. -Rob --~--~-~--~~~---~-

Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-11-29 Thread Rob Hudson
In another thread I wrote the following in regards to how to get the average for a field: > Could we educate ourselves on how other frameworks are solving this same > problem and maybe that will lead us to a solution? A quick look at ActiveRecord brings up ActiveRecord::Calculations: http://api.r

Re: How to get request.user in templatetag?

2006-11-27 Thread Rob Hudson
Ivan Sagalaev wrote: > Rob Hudson wrote: >> The place I need it is the: >> class CommentFormNode(template.Node): > > You probably need it in this node's 'render' method. There you have a > context passed to it and this context is exactly the thing th

How to get request.user in templatetag?

2006-11-27 Thread Rob Hudson
I'm making a templatetag and would like to display some user specific information along with the output. I'm doing a check to see if the user has left a comment on an object: user_comment = Comment.objects.filter(content_type=self.ct, obj_id=self.oid, user=request.user) But in my template

A RESTful Django?

2006-11-17 Thread Rob Hudson
Crazy thought of the day as I read certain REST posts[1]: Imagine built-in REST URLs the encompass the same functionality that the admin has: * get list of models * get list of all objects in model X * get/update/delete/add object * etc. >From there, the admin and getting at the content

Re: ./manage.py dbdump > mydata.sql

2006-11-17 Thread Rob Hudson
Russell Keith-Magee wrote: > I've got a prototype of just such a thing as part of the test fixtures > framework I am working on. It will dump the current contents of the database > in a db-independent format (using the serialization framework). You can then > use this dump as a fixture for later t

./manage.py dbdump > mydata.sql

2006-11-16 Thread Rob Hudson
Would something like this be a useful thing to add to manage.py? It would be a convenience similar to dbshell in that the database credentials are already in settings.py and you can easily do a database dump of your data. -Rob --~--~-~--~~~---~--~~ You received

Re: How about a real django installer?

2006-11-14 Thread Rob Hudson
James Bennett wrote: > Anybody with experience on these platforms want to step up and help > out with easier install processes? On Mac OS X I installed MacPorts (macports.org), then did a "port install py-django-devel" and it pulled down Python and Django for me. I had to also "port install py-sq

OT: JSON responses and mimetypes?

2006-11-13 Thread Rob Hudson
I'm building a rating system using AJAX (well, maybe AJAJ?) in Django. I've got it working and am doing some clean up and validation work. A few questions: 1. If a request is invalid, what is the appropriate or common thing to do? Send a JSON error message? Send a 404? Something else? 2. Usi

Re: model question

2006-11-09 Thread Rob Hudson
I'd kind of think that in Vote you don't need the poll FK, just the choice since the choice then maps to a particular poll. Though the Django admin won't do inline editing of FK relationships more than 2 deep. Otherwise I think the effect your seeing makes sense. There is nothing in these model

template tag or template filter? (Or just a bad idea?)

2006-11-08 Thread Rob Hudson
I'm wanting to add support for a sort of template language in the database content for our content providers. We came up with this as a good syntax: {% link URL as NAME [with KEY=VALUE [KEY=VALUE] [...]] %} [ and ] aren't required, I'm just indicating the optional elements. Our idea is we'd r

question on whether to cache my query or not?

2006-11-06 Thread Rob Hudson
I'm trying to reduce a SQL call to a MySQL database and I'm curious if Django tries to do some of what I'm doing or if my method makes sense. I'm making a ratings app to rate ideas (a 1 to 5 star type of thing). In my template I want to list both the number of ratings and also the average rati

Re: So I made a forum with Django

2006-11-04 Thread Rob Hudson
argh44z wrote: > Here: http://huzzah.cc/ > > I'm thinking about cleaning up the code and open-sourcing it. Is anyone > interested? I ask this because 3 weeks ago when I started working on > it, I didn't really see much forum software written with Django that > was in much actual usage. There were

Re: OT: MySQL to SQLite?

2006-11-04 Thread Rob Hudson
Russell Keith-Magee wrote: > I run OSX at home, running the DarwinPorts tools. Once I found those, > gettng starting was relatively straightforward. > > If someone is looking for some way to contribute, a proper OSX > mpkg/dmg with a full Django stack would be a nice starter project. Actually, Da

Re: OT: MySQL to SQLite?

2006-11-03 Thread Rob Hudson
iain duncan wrote: > I would honestly say it will take much less time for him to get mysql > running on the laptop ( which is simple with fink ) than to figure out a > nice porting system. You're right. I was making the assumption that SQLite and pysqlite would be an easier install process for

Re: OT: MySQL to SQLite?

2006-11-03 Thread Rob Hudson
Rachel Willmer wrote: > How about using SQL? > > On a *nix machine, you'd use mysqldump to output the db in sql format, > then use the ".read" command in sqlite to read it in. > > For the reverse journey from sqlite to mysql, it would be the > ".output"/".dump" commands to create the sql file, a

Re: OT: MySQL to SQLite?

2006-11-03 Thread Rob Hudson
Russell Keith-Magee wrote: > The serializer modeltests is probably your best bet if you are looking > for examples. However, it's a pretty straightforward interface - > > for obj in serializers.deserialize("python", data): > obj.save() I'm just curious... when the multi-db branch comes in,

Re: OT: MySQL to SQLite?

2006-11-02 Thread Rob Hudson
Russell Keith-Magee wrote: > The easiest way I can think of would be to use the serializers; > serialize the contents of the MySQL database, and deserialize it into > SQLite. I read the docs on this. Would the steps be something like this? * With database set to MySQL with content: * Serialize

OT: MySQL to SQLite?

2006-11-02 Thread Rob Hudson
Off topic question... We're working with a contractor for some template/CSS work. He's got Django on his Mac laptop. We've got Django using a MySQL database. It would be nice if we could suck up the data in SQLite and just zip up our Django directory for him to do his work with real content

Re: X-View headers

2006-10-31 Thread Rob Hudson
Jeremy Dunck wrote: > It has to be a HEAD request. When I send a HEAD request to the one that was working, now it returns this header (which looks like a bug, and probably relates to ticket 1840 (http://code.djangoproject.com/ticket/1840) which looks complicated: X-View: django.contrib.auth.

Re: django for non-web apps?

2006-10-31 Thread Rob Hudson
I think the tricky part is what Guillermo is saying. All views take a request object and return a response object. You'd have something that would have to mimic HTTP requests and work with HTTP responses. At that point it seems like you should just create your MVC pattern-based app using an ORM

X-View headers

2006-10-30 Thread Rob Hudson
I found the bookmarklets in the admin doc pages and thought this would be a useful thing for our teams to use. As a quick test I used curl -i URL to see if the headers are set and they aren't. I told curl to use my current Firefox cookies (-b flag) and they still weren't there. So I set up the

Re: import django in a Python script?

2006-10-27 Thread Rob Hudson
> If it was me wanting to generate a static site like this (I had to go > and look up what SCORM was), I would use the wget solution. It's fast > and a is going to extract pretty much exactly what a generic user will > see (the differences will be if you have any content that varies on > cookies o

import django in a Python script?

2006-10-27 Thread Rob Hudson
We're looking at a way to "script out" a Django database driven website to static HTML files to be used to bundle and build a SCORM package. At first I thought we could simply wget the version on the server and save each file. But what seems better would be to write a script that iterates over t

Re: Comments and karma tutorial

2006-10-24 Thread Rob Hudson
I've been looking at this as well. It appears that the ratings and comments are tied together and must be submitted together. Is this true? I'd like a user to submit a comment along OR rate it OR both. Is that possible? --~--~-~--~~~---~--~~ You received this m

Re: Django emailing the administrators

2006-10-19 Thread Rob Hudson
James Bennett wrote: > A while back I wrote up how to do that, and a few other useful hacks > to the comment system: > > http://www.b-list.org/weblog/2006/07/16/django-tips-hacking-freecomment I'll benefit from reading your other tips as well. Akismet is on my list to figure out as well. Very n

Django emailing the administrators

2006-10-19 Thread Rob Hudson
I set up comments on my blog and want them to be emailed to me so I know when I get traffic. Is there something in the comments framework to do this easily? I'm looking at the code and PublicFreeCommentManipulators.save() doesn't have a call to mail_managers(). But I wasn't sure if there were a

Re: making the default webserver multithreaded

2006-10-19 Thread Rob Hudson
Could you explain what this is doing? It looks like you're defining a new HTTPServer class which overrides the one being used as a parent class to WSGIServer. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: New Django Screencast

2006-10-18 Thread Rob Hudson
Nicely done. :) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTE

Modular apps question

2006-10-16 Thread Rob Hudson
I have a central app that is going to be in all projects. I have a few ancillary apps that may or may not be part of my project. What I'd like to do in my main view code is to see if the app is loaded before I invoke a call in that ancillary app. Would the best bet be to pull in settings.INSTAL

Re: print_r

2006-10-16 Thread Rob Hudson
On Oct 16, 1:00 pm, "Terry" <[EMAIL PROTECTED]> wrote: > Easiest way I've found to do it is to add the following as the first > two lines of the view function that you want to debug: > > import pdb > pdb.run_trace() > > Then, when you attempt to load the view, you will get the (pdb) prompt

Re: print_r

2006-10-16 Thread Rob Hudson
On Oct 16, 11:17 am, Steven Armstrong <[EMAIL PROTECTED]> wrote: > A djangofied version of this [1] would be cool. > > [1]http://pythonpaste.org/screencasts/evalerror-screencast.html I agree. That would be very useful. One could argue that it should only be accessible when running under WSGI.

Re: django embedded web server

2006-10-16 Thread Rob Hudson
I'm also of the opinion that Django can only benefit by making the built-in development web server better. If I can develop Django projects without the need to install Apache (or other web server) and use SQLite, that's awesome. For static files I can just use something like this: (r'^(

Re: print_r

2006-10-16 Thread Rob Hudson
[EMAIL PROTECTED] wrote: > I quite often plug in a nonsense command e.g. "fudge" just to raise the > debug page, maybe with a few I do the same. It would be awesome if there were a "debugger" app (contrib app anyone?) that we could load in the template: {{ debugger }} That would show a unobtru

Re: Auth and flash

2006-10-14 Thread Rob Hudson
Use an Apache based authentication on that directory? Roodie wrote: > Hi, > > I am working on a web application at the moment, and I have a question > about the authentication mechanism. > The interface of the application will be a flash app. No page reloading, > no redirects - only a big flash f

Re: What IDE do you use? (semi-OT)

2006-10-13 Thread Rob Hudson
Should Django look at creating something like what RadRails is for RoR? http://www.radrails.org/ It's built on top of Eclipse. The screencasts look pretty cool. -Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: django embedded web server

2006-10-11 Thread Rob Hudson
Malcolm Tredinnick wrote: > The development server is only single threaded. So one request at a > time. Since requests include each and every stylesheet, every image, > etc, that can be quite a number of requests per page. Can or will this ever change? If I understand correctly, the base WSGI we

Re: Django documentation search bar plugin for Firefox

2006-10-06 Thread Rob Hudson
I simply added a Firefox keyword search on the Django search box on the docs page. Now I type this into my URL: "dj template tags" and I get what 'm looking for. More info are smart keywords: http://www.mozilla.org/products/firefox/smart-keywords.html -Rob --~--~-~--~~

Re: 2 ways to render HTML snippet, which is preferred?

2006-10-05 Thread Rob Hudson
It's looking like option #2 might be best for my case... I'd like make one general method to handle the building of the question context and depending on the question type render one template snippet vs another. Since inclusion_tags are tied to a template filename, this isn't going to work. -Ro

Re: Does anybody solved the django project distribution problem?

2006-10-05 Thread Rob Hudson
I haven't solved the problem. For now it's on the back burner. We'll need to find a solution to this eventually. As a fall back we can always wrap up our Django app in an installer (NSIS) and launch it locally. But it would be super nice if it were as simple as a py2app or py2exe solution. On

Re: DRY in templates

2006-10-04 Thread Rob Hudson
Unless I didn't read closely enough, this sounds to me like you could use inclusion tags: http://www.djangoproject.com/documentation/templates_python/#inclusion-tags --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

2 ways to render HTML snippet, which is preferred?

2006-10-03 Thread Rob Hudson
I'm working on a way to allow our content creators to put certain form elements on pages based on question types (open text, radio, checkbox, likert scale, etc). I can see 2 ways of accomplishing what I'm trying to do. As pretext, I have 2 models: Question and Option. Option has a ForeignKey re

Re: contrib comment system

2006-10-03 Thread Rob Hudson
I just worked on this last night. Actually, I copied the comments system to my project app folder and hacked it apart to support what I wanted it to do. I did that thinking that I'd leave the upgrade path open. Plus, I learned a lot about how comments work. I found this wiki page a good resour

Re: menu submenu system

2006-10-03 Thread Rob Hudson
I did something like this recently on a project. The way I approached it was to come up with a dataset that represented the menu at the template level with the various bits I needed to know in order to open another level, etc. Something like this: menu = [ {'title': title, 'url': url, 'active

Django as a generic authentication system across various web apps?

2006-09-29 Thread Rob Hudson
At our company we have various legacy websites that we've created using different toolsets (mostly PHP/MySQL). We're looking at building a public facing authentication system that logs in a user and presents a list of authorized websites they can visit. This list is a launching point to various

Re: Python based syntax highlighter for HTML?

2006-09-25 Thread Rob Hudson
Hmmm... I wonder how hard it would be to create a template filter for Django using SilverCity. It looks like SilverCity is the preferred highlighter for Trac: http://trac.edgewall.org/wiki/TracSyntaxColoring Though you say you've heard bad things. I'll have to do some deeper digging. Thanks,

Re: Template For Loops

2006-09-25 Thread Rob Hudson
In your view are you passing game_name into the template context? For more info: http://www.djangoproject.com/documentation/templates_python/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

A general place for a request.POST handler across all pages?

2006-09-25 Thread Rob Hudson
I'm building an app that is going to have many types of forms for user data (think surveys, little questions here and there, hidden forms, etc.) What I'd like to do is come up with a naming scheme for the field names so I can place a request.POST handler in one place that can parse the field n

[OT] Python based syntax highlighter for HTML?

2006-09-25 Thread Rob Hudson
Geshi is written in PHP... Is there a Python equivalent? http://geshi.org/ --~--~-~--~~~---~--~~ 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

Re: Tutorial for including content across all pages

2006-09-25 Thread Rob Hudson
I think what you want is this: http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-tags --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: way to tell admin *not* to display a model?

2006-09-21 Thread Rob Hudson
That gives me an error in the admin: (1054, "Unknown column 'page_text._order' in 'order clause'") My case is almost identical to the example in the documentation: class Text(models.Model): page = models.ForeignKey(Page, db_index=True, edit_inline=models.STACKED) # ... class Meta:

way to tell admin *not* to display a model?

2006-09-20 Thread Rob Hudson
I've got a few models that are foreign key models to my main model which is called "Page". In the Page model I want those foreign models editable inline and I want the inline model ordered by a certain key. So I added an inner class Admin to my foreign key models with the property "ordering". Bu

Re: Generalized questions as forms and user response handling?

2006-09-19 Thread Rob Hudson
I see 2 solutions: 1) A manipulator and view function for each form. A URL mapping to the view function. Advantage: Some work done for me. Unresolved: - The form response handling will be duplicated across each manipulator. - Not sure how to pull user response data back into the form if they n

Generalized questions as forms and user response handling?

2006-09-18 Thread Rob Hudson
Hi fellow Django users, I'm coming up on a phase of a project where I need to do a lot of work with Forms and Manipulators. I've got some historical bits of old CMS ideas that I'm trying to work with. I wanted to ask Django-users if this approach seems reasonable, or if another approach woul

Re: models wierdness

2006-09-18 Thread Rob Hudson
Thanks for the reply. :) --~--~-~--~~~---~--~~ 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 [EMAIL

Re: Serving multiple projects based on different Django versions

2006-09-15 Thread Rob Hudson
Thanks everyone for the suggestion. -Rob --~--~-~--~~~---~--~~ 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

Serving multiple projects based on different Django versions

2006-09-15 Thread Rob Hudson
Here's something I realized we're going to have to face one day as I read the post on the new Forms and Manipulators... We have an active project we're coding against 0.95. Fast forward to 6 months or so after 1.0 is released and we have a few projects underway based on 1.0. We have no time or

Re: Flatpages and home page

2006-09-13 Thread Rob Hudson
Guillermo Fernandez Castellanos wrote: > There is an option, the APPEND_SLASH in CommonMiddleware, that will > rewrite URLs that lack a trailing slash to be redirected to the same > URL with a trailing slash, unless the last component in the path > contains a period. > http://www.djangoproje

Flatpages and home page

2006-09-13 Thread Rob Hudson
I set up a flatpage for my local homebrew club to target the index page. To do this I set the URL for the flatpage to be "/". Today I got a few reports that when users visited my site by typing "www.cascade-brewers.com" they got nothing. But if the added the trailing slash "www.cascade-brewers.

Re: Still unclear about image urls in a template

2006-09-07 Thread Rob Hudson
keukaman wrote: > It seems that it may not be the best practice to have more http:// > calls than is absolutely necessary in a file. > > Is there a better way to do this? It's unclear to me what your asking... Are you asking whether having many images in your template is bad? Or are you asking

Re: Programtically changing templates the "Django way"

2006-09-06 Thread Rob Hudson
Adam Mikeal wrote: > So, how can I alter/change the html for each different conference > without either rewriting all of those "content" templates each time, or > requiring a bunch of include statements in every template? Also, I > don't want to have 20 template pages for each conference, when onl

Re: {% include %}'d files not interpolating {% block %}s?

2006-09-06 Thread Rob Hudson
Cole Tuininga wrote: > Fair enough. Is there a better way to accomplish this? I'd much > prefer to have the title defined within the template rather than > having to pass it in as a variable from the view... I think you just have to think about it the other way around. Instead of each template

Re: login/logout oddities

2006-09-01 Thread Rob Hudson
What is your TEMPLATE_DIRS setting? --~--~-~--~~~---~--~~ 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

Re: login/logout oddities

2006-09-01 Thread Rob Hudson
I'm not sure but you can verify a couple things... Look at your settings.py file and make sure your TEMPLATE_LOADERS directive has the 2 in this order: TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_so

Re: Does "extends" also copy "load" declarations from base template?

2006-09-01 Thread Rob Hudson
Adrian Holovaty wrote: > No, this isn't the case -- loaded template tags/filters aren't made > available in child templates. This happens on purpose, so that a child > template is less coupled to its parent template. If you're extending a base template, aren't you already coupling the two? I cou

Re: Creating class object in template tag?

2006-09-01 Thread Rob Hudson
Why not have your template tag take a 2nd and 3rd argument: filter and order by. I'm not sure how exactly that works with the "as". Maybe: {% get_amazon_book_list title author as amazon_book_list %} ? --~--~-~--~~~---~--~~ You received this message because you

Does "extends" also copy "load" declarations from base template?

2006-09-01 Thread Rob Hudson
If not, should it? If I'd like do have markup on my whole project it would be nice to set it once in base.html via {% load markup %} and have it automatically loaded in each template that extends base. I just tried this with template tags and it didn't work but I'm curious if it would be a usefu

<    1   2   3   >