Hi there ...
(this is also posted to
stackoverflow:
http://stackoverflow.com/questions/1504537/django-session-intermittently-disappears-just-after-login)
In my django app, I handle login in the following manner. Users go to a
gateway page (index.html) - if they are not currently logged in,
Hello ...
I have a tree like structure created out of models using ForeignKey
linkages. As an example:
Model Person:
name = CharField
Model Book:
name = CharField
author = FK(Person)
Model Movie:
name = CharField
director = FK(Person)
Model Album:
name = CharField
On Mon, Sep 7, 2009 at 2:55 PM, Samuel Hopkins wrote:
> Anyhow, the purpose of this email was just to ask the community what
> editor(s) they preferred to use with Django.
Emacs
--~--~-~--~~~---~--~~
You received this message because
Err, sorry, I meant to cancel and sent this instead. I believe I found my
problem while preparing to email about this (wasn't looking close enough
at the error message, and it looks like apache was looking in the wrong
python's site-packages)
On Thu, 2 Apr 2009, Jeff Gentry wrote:
>
>
Ok, so I've managed to get django running using mod_python on some other
machines, but today I'm being stymied:
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
Sorry for the self-followup, but I got the right bits of extra. My actual
case was a bit more complicated than my example below (it involved a
fourth model), but it's working now - and much quicker than w/ the IN
directive. Thanks.
On Fri, 6 Mar 2009, Jeff Gentry wrote:
> On Fri, 6 Mar 2
On Fri, 6 Mar 2009, Malcolm Tredinnick wrote:
> > Bob.objects.filter(foo=myFoo).filter(blah__in=myBlahs)
> Seems like the best (and obvious) way to me.
Gotcha.
> Yes it does. As written, your models have no ordering requirements. That
> complete lack of constraint is preserved perfectly. :-)
Suppose I have three models (in pseudocode):
class Foo:
asdf = models.CharField()
class Blah:
qwerty = models.CharField()
class Bob:
foo = models.ForeignKey(Foo)
blah = models.ForeignKey(Blah)
Given a Foo and a list of Blahs (where the length of the list might be
very small (0-10)
In my project I have a need to generate CSV output files for
download. Some of these files aren't overly large - 1-20MB or so, but
they can get quite big (currently the largest are several hundred MB and
this could grow with time).
This would appear to be a case where there's no magic bullet,
> and suppose "obj_a" is your given A instance. Then I suspect this is the
> type of queryset you're after:
> C.objects.filter(Q(to_a=obj_a) | Q(to_b__to_a=obj_a))
This did the trick Malcolm, thanks. I'm not sure what was hanging me up
as I could swear I had tried this one already, but
> you've used the value "#fff", that will be interpreted by the browser as
> a reference to the current page (#fff being an anchor, and not passed to
> the server). Ergo, a second request is made.
Wow, thanks. Just reading through your step by step taught me some things
I didn't know :)
> The
> Quoting from the book of "if you hear hoofbeats, think horses, not
> zebras": This obviously isn't normal Django behaviour and since calling
> views is easily the most common operation in Django, it's safe to assume
> that any breakage here in Django would have been noticed by other
> people.
Another piece of info, in case it's useful here - the page does *not*
render on the first view call, it's only after the second call that the
page will render. I don't think it's even pulling up the template until
the second go-around, as a test I put some intentionally bad template code
in a
> How have you noticed that view was triggered twice?
I noticed that the URLs were displaying twice in the devel server console
(and in HTTP logs for when running off of apache). For the former case, I
put a print statement in the view function - when loading those pages, the
print is triggered
Actually I lied a little bit - a completely blank file doesn't trigger
this (I can also seem to put in a and tag), but adding
anything else will cause the view to be loaded 2x.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
In my apps, I'm finding that my views are triggering twice. I have a
series of related apps, working off of the same settings.py file (there's
a global urls.py, which triggers off of the first string and sends to a
subdirectory w/ it's own urls.py/__init__.py/models.py/views.py/etc. With
one
> Oops. It could also read
> from django import newforms as forms
> in which case you should change it to
> from django import forms
Right, that's what I was thinking.
> but I hope you've got the idea: basically newforms has *become* forms.
Yup - just wasn't sure on that. I had
Hi there ...
To date, I've not been using Django's form system (nor 'newforms'), but am
trying to integrate another app into a suite that I'm developing. The
code on this is a bit older and is using newforms - when I fire up the
server (running off of the 1.0 branch) I get "No module named
On Tue, 23 Sep 2008, Berco Beute wrote:
> But now I want to use HTML in the body of the email. How do I format
> such a message and can I just send it like above?
Emails should be plain text, not HTML ;)
--~--~-~--~~~---~--~~
You received this message because
> I don't think that is true, the only time I needed root was when I was
> symlinking django into /usr/lib/python2.5/site-packages/ but since you
I've run Django on machines w/ no root access and nothing special
installed for me. Granted I've been running off of non-standard ports,
but ...
Hi there ...
In case anyone comes across this in the future, I solved the
problem. libpq wasn't getting picked up by the process, all's well now.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
Hi there ...
I'm running Django-svn, mod_python 3.3.1, apache 2.2.3-11, python 2.5.2,
psycopg 1.2.21 & mxdatetime 2.0.6.
On my machine I can run everything perfectly fine via the manage.py shell
as well as the development server. However, when I try to fire up a
connection running out of
> I'm using PostgreSQL - one question I had was that when I run syncdb,
> the tables that are created are under the default 'public' schema.
> Is there a way to specify syncdb to create these tables under another
> schema name?
Er, sorry about that. If I created the schema first, syncdb stuck
Hi there ...
I'm using PostgreSQL - one question I had was that when I run syncdb, the
tables that are created are under the default 'public' schema. Is there a
way to specify syncdb to create these tables under another schema name?
--~--~-~--~~~---~--~~
You
I have a setup that I figured I could just crib off of the
User/Group/Permission code because the setup is basically identical, but
falling a bit short here (perhaps I'm just not looking at the right code).
I have three classes, As, Bs & Cs.
A has a M2M relationship with both B & C.
B has a M2M
On Fri, 11 Apr 2008, Kenneth Gonsalves wrote:
> > {% if forloop.counter % 2 %}
> divisibleby
Actually, he should be using 'cycle'
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
On Mon, 31 Mar 2008, ydjango wrote:
> u'jsklajdkls'}, {'food_name': u'PMC', 'group': 1L, 'description':
> u'jsklajdkls'}]
> ( why do I see u before text in output above?)
It indicates that they're unicode strings.
--~--~-~--~~~---~--~~
You received this message
> Is there some graceful way to have the Django unit test framework
> access the "production database" for certain tests as opposed to
> creating a test db? The idea is to do a basic sanity check of the
> "production db" in case the schema has changed and the db needs to be
> rebuilt.
Hi there ...
As a relative newcomer to Django, I recently starting looking at how best
to implement unit tests for my app. I came across this page:
http://www.djangoproject.com/documentation/testing/
as well as a couple of other examples online.
If I'm understanding things correctly, the unit
I'm sure I'm missing something small/stupid here, but it has me
stumped. I have a legacy database system which I'm writing some django
applets for - up until now it has been purely read-only, but working on
making something which can write as well. I've created a minimal test
case here which
> Man I hear you. I've been doing web for 10 years, in a variety of
> languages. I have Django installed VERBATIM according to the
> documentation.
> I can get Django to run, but I can't get it to server images using the
> built-in server. mod_python is a whole other ball of wax. I have
>
31 matches
Mail list logo