On Wed, Sep 9, 2009 at 5:06 AM, Oleg Oltar wrote:
> Hi!
>
> One of my tests returned following text ()
>
> The test:
> from django.test.client import Client
> c = Client()
> resp = c.get("/")
> resp.content
>
> In [25]: resp.content
> Out[25]: '\r\n\r\n\r\n Strict//EN"
> "http://www.w3.org/TR/xh
shabda wrote:
> I have tried to write a Django tutorial for Appengine.
> A live install of this can be seen at http://blogango.appspot.com
I get a 403 Forbidden when I try to vote...
Kent
--~--~-~--~~~---~--~~
You received this message because you are subscribe
shabda wrote:
> I am trying to follow http://code.google.com/appengine/articles/django.html
>
> Which has a line
> # Log errors.
> django.dispatch.dispatcher.connect(
>log_exception, django.core.signals.got_request_exception)
>
> but log_exception is not defined/imported, so it gives a NameE
meppum wrote:
> I've been doing something like the following:
>
> MODELS = [SomeObjectType, AnotherObjectType]
>
> class testFoo(TestCase):
>
> def tearDown(self):
> for model in MODELS:
> model.objecs.all().delete()
>
> Is this how tests should be created, or is all this done
A simpler question - is there any reason *not* to include this code in
my model's save() method?
try:
Model.save(self)
except DatabaseError:
transaction.rollback_unless_managed()
raise
The benefits:
- automatic recovery from failed unmanaged transactions - very handy
when working
When accessing a Postgres database from Django ORM without any explicit
transaction management, any database query begins an implicit
transaction which ends with the next save().
If the save fails due to a database error (e.g. integrity violation,
timeout...) it raises an exception. At this po
Jan Rademaker wrote:
> There is an undocumented class called QNot which resides in
> django.db.models.query.
That is just what I was looking for. Thanks!
Kent
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Djan
Doug B wrote:
> I think you want filter's evil twin exclude:
I know about exclude() but I don't see how to use it here.
I want s1==1 OR s2!=1, so for example records (s1=1, s2=1) and (s1=2,
s2=2) would be accepted.
filter(s1=1).exclude(s2=1) is s1==1 AND s2!=1; it will not retrieve
either of
Is there a way to express != in a database query?
Suppose I have a field 'status' that can take the values 1, 2 or 3. If I
want to select status!=2 I can use exclude(status=2). But for more
complicated conditions this is harder to do. What if I have two status
fields, s1, s2 and I want to sele
I am trying to add an app to
http://code.djangoproject.com/wiki/DjangoResources
but when I submit I get
500 Internal Server Error (Submission rejected as potential spam)
How can I get this to work? I am trying to add this to the "Django
application components" section:
* [http://blogcosm.com
PreFab Software has released Blogmaker (tm), a full-featured,
production-quality blogging application for Django. It supports
trackbacks, ping and comments with moderation and honeypot spam
prevention. Blogmaker is free, open-source software licensed under a BSD
license.
Blogmaker powers the
Ned Batchelder wrote:
> I have been hoping, but not managing, to find the time to create a
> Django implementation of my anti-spam technique: Stopping Spambots with
> hashes and honeypots (http://nedbatchelder.com/text/stopbots.html). It
> works very effectively without any extra work on the
Kenneth Gonsalves wrote:
>
> On 20-Oct-07, at 3:07 PM, Justin Lilly wrote:
>
>> I believe the answer will be no. The main reason being #3 as I
>> think most other obstacles can be overcome. I would suggest
>> webfaction as an alternative (from word of mouth, not personal
>> experience).
>
Wiley wrote:
> Dirk,
>
> Thanks for your comment! I simplified my use case for the sake of
> clarity, but in my actual application it does make sense to have
> Dishes and Restaurants to be many-to-many. Does anyone have any
> insight as to my original question? Can the choices of dish be
> nar
Martin Winkler wrote:
> If you want do do really nice graphs, you might take a look at some
> screenshots of matplotlib:
> http://matplotlib.sourceforge.net/screenshots.html
>
> The module is quite large, but has really many functions: from simple
> pie charts (3D too) up to finance charts which
Mike H wrote:
> Hi all,
>
> We've just released an update to the django dbmigration project. This
> release cleans up the code a little and improves the parsing of SQL
> migrations.
>
> Homepage and downloads at:
> http://www.aswmc.com/dbmigration/
The download link is not working (404).
Ken
hass wrote:
> I'm trying to set up a model with a field that swallows a healthy
> dollop of html, such as a youtube embed code.
>
> But then, I want to use regular expressions to strip that code into
> pieces that I can access independently. My first thought is that some
> regular expression kun
RajeshD wrote:
>
>> search_fields = ['question', 'choice_choice']
>>
>> Where choice_choice is supposed to be pointing to the choice field in
>> the choice model, but something is not working with that. I am sure
>> that I am missing something very easy and I was wondering if someone
>> could po
James Bennett wrote:
> On 5/11/07, Nic James Ferrier <[EMAIL PROTECTED]> wrote:
>> Something needs to be done though... or ongoing maintenance of Django
>> apps is going to be really hard.
>
> I haven't found it terribly hard with a little coding discipline; the
> way we've handled it is to write
Kent Johnson wrote:
> Enrico wrote:
>> Can't you just override the 'save' method of your model?
>
> Maybe I can. I think I once had a reason not to do that but I can't
> remember it :-)
Yes, this is fine, thanks for nu
Aidas Bendoraitis wrote:
> I would have written a request_middleware instead of what you did. I
> think, it would be cleaner.
The middleware would have to inspect each request to find the ones it
actually cares about. It seemed cleaner to me to use the url dispatch to
do this for me.
Thanks,
K
Enrico wrote:
> Can't you just override the 'save' method of your model?
Maybe I can. I think I once had a reason not to do that but I can't
remember it :-)
Thanks,
Kent
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gr
In my application I want to intercept changes made through the admin
interface so I can make additional changes based on the changes made by
the user. In other words, if the request has a new value for attribute
'foo', I want to compute a new value for attribute 'bar' and add that to
the request.
23 matches
Mail list logo