On May 27, 3:10 pm, Pirate Pete wrote:
> hello again,
>
> i am trying to get a single entry from my db and then annotate the
> count and rating to it like we established above
>
> however it doesn't seem to be returning anything:
> videos =
> Video.objects.get(id=vid_id).annotate(rating_count=Coun
Hi,
I am trying to test my pages that need authentication. But, I am not
able to test views that need authentication. I have tried following
threads about logging in test client in this group and django
documentation, but still cant figure out.
This my view I am trying to test:
def cauction(reque
I have just upgraded my version of Ubuntu, which then also installed
Python 2.6. I thought this was a good opportunity to upgrade to
Django 1.2. I removed all traces of Django 1.1.1 that I could find,
along with extra plugins/modules/apps etc, and ran the install for
Django 1.2.1, checking that I
On May 28, 9:56 am, Derek wrote:
> I have just upgraded my version of Ubuntu, which then also installed
> Python 2.6. I thought this was a good opportunity to upgrade to
> Django 1.2. I removed all traces of Django 1.1.1 that I could find,
> along with extra plugins/modules/apps etc, and ran the
On May 28, 9:23 am, irum wrote:
> import unittest
> from django.test.client import Client
> from django.test import Client, TestCase
> from django.contrib.auth import authenticate
> from django.contrib.auth.models import *
> from django.core import mail
> import datetime
> import time
>
> class
At a first glance it looks like a problem with your urls. Could you show us
your custom template and url definitions from urls.py?
Nuno
On Thu, May 27, 2010 at 7:10 PM, Pankaj Singh <
singh.pankaj.iitkg...@gmail.com> wrote:
>
>
>
>
> Exception Value:
>
> 'function' object is not iterable
>
>
>
>
Hi all
I want to annotate a qs with a computed field from one of its current
fields, and then filter on the annotated field. I cannot work out how
I'm supposed to do this in the ORM (or even if I can).
Basically, I have a model with a username field, that in this case
contains an email address. I
'c' is written here by mistake, I was trying different things by and
commented out the wrong statement while pasting. It was,
r = self.client.post('/createauction/', post_data)
Also, could the problem be with my Python version 2.6.5 and Django
1.1.1 as stated in this thread:
http://groups.googl
Hi Tom,
Whilst Django annotation is great, it is rather simplistic in nature
and can only do very basic Count, Sum, Avg, etc. which do not allow
any filtering (i.e. a WHERE clause in the SQL).
Unless there are major differences in 1.2 (which I haven't seen) then
you won't be able to do what you w
Darren,
This seems like quite a complex problem and I'm not sure whether the
Django ORM would be up to it. I've had a lot of trouble when using
multiple annotations on Querysets when JOINs are involved as Django
does the wrong thing.
Have you considered using a schemaless DB like MongoDB for your
Django 1.2 is more than happy to filter on aggregates and annotations, see:
http://docs.djangoproject.com/en/1.2/topics/db/aggregation/#aggregations-and-other-queryset-clauses
My problem is that I can't see how to specify this additional computed
field as an annotation, and can only coerce it in w
Hi,
darren wrote:
> I upgraded django version from (not exactly sure) about 1.0 to 1.2.
> After doing so, if I run manage.py syncdb, I get messages saying I
> need to add unique constraints. I added "unique=True" to the columns
> in the model that were indicated. However, I continue to get the
>
Try...
http://alpha.djangogenerator.com
It will generate a substantial amount of boilerplate code for you.
Including templates and various views for listing, editing and viewing
models, and admin access with admin documentation setup too. It is
helping me greatly with folder layout and basic fun
On Fri, May 28, 2010 at 2:33 AM, Philipp wrote:
> Thanks a lot Karen, I did google and found some more info here:
>
> http://trac.turbogears.org/ticket/2133#comment:11
>
> just as a note, this is an issue on Django Developer Kit 1.2.1
>
>
FYI this has now been fixed in Django trunk:
http://code.d
On Fri, May 28, 2010 at 5:42 AM, irum wrote:
> I have also tried after updating my django-trunk but the problem
> persisits. Should I downgrade to Python 2.6.4 to fix this?
>
The problem you reference has been fixed in 1.2.x (and also 1.1.2), so if
updating to current Django code did not fix the
Hello,
how to fetch the DoesNotExist exception generated by get_object_for_this_type?
Being generic i can't use the actual model.
I tried something like that, but i doesn't seem to work, the original
exception is still raised.
from django.contrib.contenttypes.models import ContentType
from dja
On May 28, 1:33 pm, Dirk Eschler wrote:
> Hello,
>
> how to fetch the DoesNotExist exception generated by get_object_for_this_type?
> Being generic i can't use the actual model.
>
> I tried something like that, but i doesn't seem to work, the original
> exception is still raised.
>
> from django.c
Am Freitag 28 Mai 2010, 14:43:21 schrieb Daniel Roseman:
> On May 28, 1:33 pm, Dirk Eschler wrote:
> > how to fetch the DoesNotExist exception generated by
> > get_object_for_this_type? Being generic i can't use the actual model.
[...]
> The DoesNotExist exceptions for each model are subclasses of
I think Daniel might mean you can also use the __file__ attribute, as
in:
>>> import django
>>> django.__file__
Hope that helps,
Alex
On May 28, 4:07 am, Daniel Roseman wrote:
> On May 28, 9:56 am, Derek wrote:
>
>
>
> > I have just upgraded my version of Ubuntu, which then also installed
> > P
Hi! I don't know how to make django-piston save my related objects.
This is my handler file:
from piston.handler import BaseHandler, AnonymousBaseHandler
from piston.utils import rc, require_mime, require_extended
from test.networking.models import NetworkingProfile
class NetworkingProfileHandle
hi,
sou do brasil, como faço para o Django carregar os Models de qualquer
arquivo?
exemplo: carregar do arquivo usuario.py e não do models.py
alguém pode me ajudar??
(eu lei ingles, mas não sei escrever alguem aí lê portugues?)
obrigado!
--
You received this message because you are subsc
That sounds interesting. As I am new to Django, I never really gave
putting the logic in the model, although I did happen to read a little
about model methods yesterday.
Would you mind making some of your code available? I'd be interested
in seeing your approach.
Darren
On Fri, May 28, 2010 at
I'm benefiting a great deal from all other aspects of Django. So, I'm
not concerned about having to use SQL to get the job done. However, I
really want to do it the way the Django developers intended it to be
done, which may be to use raw SQL.
The only thing I don't like about addressing the sql
Thank you chr,
I've never experimented with managers, but it's quite useful.
I guess a custom manager is also the only way to have a foreignkey to a user
in a specific group.
But although I'm a bit further, I still don't know the answer to my
million-dollar question.
Is it possible to have an in
Hi All,
I thought some of you with android phones might be interested, I
knocked up a quick app to make browsing the doc site a bit easier for
me. It's in the marketplace for download. It's got some quick links to
topics I tend to lookup a lot. I was thinking of adding in custom
bookmarks and snip
On 2010-05-28, at 17:31 , jaymzcd wrote:
>
> Hi All,
>
> I thought some of you with android phones might be interested, I
> knocked up a quick app to make browsing the doc site a bit easier for
> me. It's in the marketplace for download. It's got some quick links to
> topics I tend to lookup a lo
Hey,
i want to have an optional foreign key in my model. I tried sth like
this:
person= models.ForeignKey('Person',
related_name="kontakt",blank=True,null=True)
If I try to add a new object in the admin interface it is always
complaining that i have no value selected in the person field.
Wha
Had you already run syncdb when you made the field optional? If so, you need to
use a migration tool -- syncdb doesn't change existing tables, only creates new
ones.
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group
If you're in a terrible rush, you could switch to sqlite3 during development
until you're ready to go to production.
It sounds like either psycopg2 didn't install properly, or your Django instance
is running under a different version or installation of Python than the one
where you installed th
When I do import from Python, it can't find it either. I need Postgresql
for a job. I saw a post somewhere else that says maybe my Python path is
not complete, so I will look at that when I get home.
Thanks for the reply!
Cyndi
www.mysticbostons.com
On Fri, May 28, 2010 at 12:22 PM, Shawn Mil
In the Admin application I can create related objects 'on the fly' in
a popup (e.g. when changing a User I can create Groups by pressing the
green 'plus' next to the Group list): this is done adding '_popup=1'
to the url used in the popup (e.g. "/admin/auth/group/add/?_popup=1").
The 'Save' button
Hey Shawn,
I have deleted the whole DB just to be sure. It must be sth else. I'm
using the grapelli admin interface. An SQL insert query with NULL as
foreign key is working. So it must be sth abouth the django validation
stuff.
thx,
Sebastian
On 28 Mai, 18:18, Shawn Milochik wrote:
> Had you al
Hey Shawn,
I have deleted the whole DB just to be sure. It must be sth else. I'm
using the grapelli admin interface. An SQL insert query with NULL as
foreign key is working. So it must be sth abouth the django validation
stuff.
thx,
Sebastian
On 28 Mai, 18:18, Shawn Milochik wrote:
> Had you al
I need to create a project that creates dynamic forms, which I keep in
a relational database structure and use the form MongoDB to persist
the data, keeping in different collections each form. Am I creating
this dynamic class that way [1], but I'm having some trouble returning
the seguitne error [2
I'm using an InlineAdmin that is a generic relation, similar to django
tagging, with one of my model admins. The problem is on a save as
new, if the original object has tags, then the initial form count,
gotten from the management form, isn't zero, even though the new
object will have zero tags, c
Still hoping someone has some insight here. I've been plugging away
at it and am still not finding an answer I can live with as an
engineer.
Currently I'm cheating a bit to filter down by only published objects
in my view like so
tag = get_object_or_404(Tag, slug=slug)
contentitems = ta
Have you checked out http://code.google.com/p/django-tagging/ ?
On May 28, 12:54 pm, Streamweaver wrote:
> Still hoping someone has some insight here. I've been plugging away
> at it and am still not finding an answer I can live with as an
> engineer.
>
> Currently I'm cheating a bit to filter d
There are ImageField and FileField in a model.
When model item removed, image and file stay.
Is it normal behavior?
Is there a way to remove image and file automatically?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
That seems reasonable. So if I want to run tests on local django workspace
and have older django installed (in daily work I use 1.1.1) I need to simply
have this django workspace added to PYTHONPATH? Won't this mess with my
default django installation?
On May 27, 2010 4:03 PM, "Karen Tracey" wrot
Yes, it seems the fault is on my side (not directly, not my code :-)).
Thanks a lot.
On May 19, 2010 3:54 PM, "Karen Tracey" wrote:
2010/5/19 Filip Gruszczyński
>
> I have just installed Django 1.2 hoping, that my test suites will
> finally work flawlessly and...
If you create a new Django pr
I have a very simple blog app and am trying to enable moderation on
the entries. I'm following the docs, but nothing seems to be
happening:
The code:
http://dpaste.com/200509/
Which would lead me to entries > 14 days old would be closed for
commenting. Not so. And no matter what I do, all comment
On May 27, 6:56 pm, Graham Dumpleton
wrote:
> You also need to add '/home/seb/MAIN/seoconquer'. Read:
>
> http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html
I tried both versions of the wsgi script on your blog. And I still get
this same error.
ImportError: No module na
I'm using Django-registration and Django-invitation. They both work on
my website, but they both come with tests that fail.
I don't think the tests are failing because the plug-ins don't work. I
think they're failing due to different testing environments. Django-
registration in particular gives m
Added this for my GenericInlineFormSet and things seem to work
correctly now:
class MyGenericInlineFormSet(BaseGenericInlineFormSet):
def __init__(self,*args,**kwargs):
self.save_as_new = kwargs.get('save_as_new',False)
super(MyGenericInlineFormSet,self).__init__(*args,**kwargs
In '/home/seb/MAIN/seoconquer', can you do:
ls -las
ls -las mvc
and post the output.
If you are concerned about revealing details send it to my email
direct.
Graham
On May 29, 7:19 am, Chris Seberino wrote:
> On May 27, 6:56 pm, Graham Dumpleton
> wrote:
>
> > You also need to add '/hom
I'm having to, in Javascript, create a dictionary ( my_dict = {} ),
then put in some Arrays.
my_dict["stringkey"] = Array("hey","hey1")
my_dict["stringkey1"] = Array("more","stuff")
In the views function:
for key in request.POST:
prop_rec = request.POST.getlist(key)
The Py
I'm having to, in Javascript, create a dictionary ( my_dict = {} ),
then put in some Arrays.
my_dict["stringkey"] = Array("hey","hey1")
my_dict["stringkey1"] = Array("more","stuff")
In the views function:
for key in request.POST:
prop_rec = request.POST.getlist(key)
The Pyth
Hello,
I have this simple code, which dives me crazy already :(
class ActiveInformer(models.Model):
informer = models.ForeignKey('Informer',
related_name='act_informers')
user = models.ForeignKey(User, related_name='informers')
class Informer(models.Model):
informer_types = (('P', 'Po
Hi guys,
I'm a relative newbie at using Django in an actual production
setting. I'm having trouble using the form wizard at the moment, and
I noticed that there is one instance of the Wizard class, instantiated
in urls.py. Is there anything I should worry about as far as thread
safety is concerne
hi I'm new in this group and I'm newbie with django.
I have this problem:
I need to have a socket reference accessible from all views in the
application. The concept is similar to the session concept, but if is
possible I need to access to the socket without using session.
have you idea about thi
I accept this as normal now. I think, what I'll need to do if I'm
against stripping off the two characters, is simply putting the value
that serves as the key, directly into the array as the last element.
Simple enough.
So in views function:
It'll look like: request.POST["imthekeyval[]"]
On Fri, May 28, 2010 at 7:41 PM, pyfreak wrote:
> However, I also need to use "key". But when I'm sending over stuff
> from javascript like above,
> the key has a "[]" tacked on the end of it, like "stringkey[]"
You are most likely running into this, or an issue similar to it in
another JavaScr
Hi,
Is it possible to use Django with Google Fusion Tables
http://code.google.com/apis/fusiontables/ as the backend?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscr
Hello, I am trying to figure out how to get a pk in the middle of a
transaction. I need to set a field in the model based on the
ID(default pk) to be given. As far as a i know, this ID should be
allocated during the transaction. So i would imagine it would do the
INSERT, then i could get the pk a
54 matches
Mail list logo