> 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
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
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
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?
>
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,
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
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
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
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
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
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
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
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
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
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]
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?
--~--~-~
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,
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
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
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 %}
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
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
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
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
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
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...
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
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
* 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
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
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
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
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
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
--~--~-~--~~~---~-
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,
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
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
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.
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
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
> 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
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
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
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
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
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
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
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
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
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.
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'^(
[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
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
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
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
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
--~--~-~--~~
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
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
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
"
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
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
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
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
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,
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
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
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
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
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:
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
101 - 200 of 235 matches
Mail list logo