Hi;
I have this model design:
http://dpaste.com/hold/199818/
class Weather(models.Model):
weather_date = models.DateField(auto_now_add=True,db_index=True)
zip_code = models.CharField(max_length=20,db_index=True )
icon_data = models.CharField(max_length=80)
class Store(models.Model):
On Thu, May 27, 2010 at 2:03 AM, Lee Hinde wrote:
> Hi;
>
> I have this model design:
>
> http://dpaste.com/hold/199818/
>
> class Weather(models.Model):
> weather_date = models.DateField(auto_now_add=True,db_index=True)
> zip_code = models.CharField(max_length=20,db_index=True )
> ic
On May 27, 10:03 am, Lee Hinde wrote:
> Hi;
>
> I have this model design:
>
> http://dpaste.com/hold/199818/
>
> class Weather(models.Model):
> weather_date = models.DateField(auto_now_add=True,db_index=True)
> zip_code = models.CharField(max_length=20,db_index=True )
> icon_data = mo
Hi,
I think it's designed to do that. See the behaviour of the
save/get_available_name methods on core/files/storage.py (in the
django source). Maybe you can write your own storage that overrides
this (never tried it, but should work).
Nuno
2010/5/26 Ricardo Bánffy :
> Hi folks.
>
> I want to pr
On Thu, May 27, 2010 at 10:35 AM, Daniel Roseman wrote:
> Does this not work?
>
> note=Note.objects.get(whatever)
> weather=Weather.objects.filter(
> weather_date=note.created,
> zip_code=note.created_by__store__zip_code
> )
> --
> DR.
Think you need more coffee :)
note=Note.objects.get(w
On Thu, May 27, 2010 at 2:38 AM, Tom Evans wrote:
> On Thu, May 27, 2010 at 10:35 AM, Daniel Roseman
> wrote:
> > Does this not work?
> >
> > note=Note.objects.get(whatever)
> > weather=Weather.objects.filter(
> >weather_date=note.created,
> >zip_code=note.created_by__store__zip_code
> >
Nobody on this issue ?
On 21 mai, 15:46, Nicolas Steinmetz wrote:
> Hi,
>
> For some actions I made from the Django built-in admin, I would like
> to improve the user experience with a better distinction between
> sucess & error messages.
>
> With Django 1.1.x, I used to use Model admin actions [
I am trying to run tests on the trunk (rev 13307) and when I do, I get:
grusz...@gruszczy-laptop:~/Programy/django/tests$ ./runtests.py
--settings test_sqlite
Traceback (most recent call last):
File "./runtests.py", line 205, in
django_tests(int(options.verbosity), options.interactive,
opti
Hello!
I have model A in which there is field ForeignKey(B). I also have
model C which inherits from model A. None of these models is abstract.
Having B object, can I find all C objects pointing to it? When I use
something like this: Bobject.C_set.all() there appears an error:
'AttributeError: B o
On Wed, May 26, 2010 at 4:28 PM, Bryan wrote:
> I am using Django v1.2
>
> The fixture I defined "forum_fixtures.json" don't seem to be loading
> when I run tests.
>
> from django.test.client import Client
> from django.test import TestCase
> from utils import *
> from forum.models import *
> fro
2010/5/27 Filip Gruszczyński
> I am trying to run tests on the trunk (rev 13307) and when I do, I get:
>
> grusz...@gruszczy-laptop:~/Programy/django/tests$ ./runtests.py
> --settings test_sqlite
> Traceback (most recent call last):
> File "./runtests.py", line 205, in
>django_tests(int(opt
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=Count('rating'),
rating_avg=Avg('rating__rating'))
i even
Hi,
I want to change the language code to english everytime the user logs
into the admin site.
What is the best way to do it? Can I extend the initial admin view?
Thanks in advance,
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to t
You're after get_model in django.db.models:
model_class = get_model(*model_string.split('.'))
See James Bennet's post in this topic:
http://www.b-list.org/weblog/2007/nov/03/working-models/
Regards
Scott
On May 27, 12:13 am, Jeffrey Taggarty wrote:
> Hey Guys,
>
> I am trying to build th
On May 25, 9:03 pm, Kenneth Gonsalves wrote:
> you need to add the path to the *parent* directory of your project, and your
> project should have __init__.py in every folder where there are python files
Thanks. I added __init__.py to an apache directory I created in my
project directory that inc
Try:
myB = B.objects.get(pk=1)
myCs = C.objects.filter(a__b=myB)
Regards
Scott
> I have model A in which there is field ForeignKey(B). I also have
> model C which inherits from model A. None of these models is abstract.
> Having B object, can I find all C objects pointing to it? When I use
> som
I fixed the path issue that was causing the spinning but now I'm back
to getting import errors even with __init__.py in my apache
directory. Here is the exact error from Apache's error.log.
...
[Thu May 27 10:18:18 2010] [error] [client 99.159.221.130]
_default = translation(settings.LANGUAG
Check your apache logs.
On Thu, May 27, 2010 at 10:06 AM, Chris Seberino wrote:
> On May 25, 9:03 pm, Kenneth Gonsalves wrote:
> > you need to add the path to the *parent* directory of your project, and
> your
> > project should have __init__.py in every folder where there are python
> files
>
>
> ImportError: No module named mvc
What's the "mvc" module? Python can't seem to find it. Is it in your
python path?
Nuno
On Thu, May 27, 2010 at 4:20 PM, Chris Seberino wrote:
>
> I fixed the path issue that was causing the spinning but now I'm back
> to getting import errors even with __init
I have this simple Blog model:
class Blog(models.Model):
title = models.CharField(_('title'), max_length=60, blank=True,
null=True)
body = models.TextField(_('body'))
user = models.ForeignKey(User)
is_public = models.BooleanField(_('is public'), default = True)
When I insert a
So, no one is running automated tests?
On May 24, 4:16 pm, dmitry b wrote:
> Hi,
>
> I'm in the process of setting up automated selenium tests for a django
> app using Hudson. As part of the build script, I'm starting up a test
> server:
>
> $> python manage.py testserver --addrport 0.0.0.0:8080
I am getting this error while accessing password reset page.I want to use
custom template for password reset page instead of standard django page.
how should I proceed.
**
I haven't think about it this way. It works (using "a_ptr__b").
Thank you for help Scott!
--
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 unsubscribe from this group, send em
On May 26, 7:02 pm, Dexter wrote:
> Another thing:
>
> At the event model, it is unnecessary to display all the events in the
> admin. How can I make sure only the events coming (ie
> date__gte=datetime.now()) are displayed in the admin?
i think a proxy model[1] might work where you set the defau
I'm looking for ideas on the best way to approach this problem.
Should I write raw SQL, stay with the ORM or even mix Javascript with
either ORM or SQL?
I want to keep up with player stats for a baseball team. I've been
reading up on aggregates and annotations. And, I'm getting somewhere
with it
On May 27, 11:46 am, Lee Hinde wrote:
> So, if I were to display a list of notes, how would I join those two
> together?
if i get you right, you could accomplish this by using a model method
get_weather(self):
weather = Weather.objects.filter(weather_date=self.created, ...
cheers, chr
--
Yo
Drats! It looks like my HTML table came out jumbled. I'll try to
post it somewhere where it is more legible. But, it will be a few
hours.
One idea that came to mind after I submitted my question was to break
out the results column into individual booleans. So, my model would
look more like:
C
I just checked this again.
I changed the fixtures name to:
$ ls forum/fixtures
forum_fixtures.json
class UserProfileTestCases(TestCase):
"""These are tests to verify that refactoring of UserProfile is
correct"""
fixtures = ['forum_fixtures.json']
$ python manage.py test
Creating test da
> > When I come to deploy my django app on Apache , I get this error.
>
> > [error] [client 127.0.0.1] Target WSGI script not found or unable to
> > stat: C:/wsgi-django-app
> > /testing/apache/django.wsgi
>
> This will occur where the user that the Apache service runs as does
> not have the neces
On Thu, May 27, 2010 at 3:34 PM, Bryan wrote:
> just checked this again.
>
> I changed the fixtures name to:
>
> $ ls forum/fixtures
> forum_fixtures.json
>
> class UserProfileTestCases(TestCase):
>"""These are tests to verify that refactoring of UserProfile is
> correct"""
>fixtures = ['
On Thu, May 27, 2010 at 12:22 PM, chr wrote:
> On May 27, 11:46 am, Lee Hinde wrote:
> > So, if I were to display a list of notes, how would I join those two
> > together?
>
> if i get you right, you could accomplish this by using a model method
>
> get_weather(self):
> weather = Weather.object
Hi all,
Here is my question details
http://stackoverflow.com/questions/2915880/django-objects-all-method-...
this is driving me crazy, after a save(), i can see the new data in
mysal db, but i cannot get new data from queryset.
Thanks in advance.
--
You received this message because you are subs
Djangoists:
Starting at ...
http://docs.djangoproject.com/en/dev/topics/testing/#django.test.client.Client.get
... how do we test with HTTPS turned on? This doesn't work:
client.get('/yo/', {}, HTTPS='on')
All we can find is documentation to turn it off, which is somewhat
fruity if it's off
Hey all,
I'm trying to set up django 1.2 to work with database replication in
MySQL. When I run syncdb, I get an integrity error when content_types
starts creating its data. Replication seems to be occurring, so I
suspect I'm doing something wrong with my routing. Is there some gotcha
I'm missi
> Starting at
> ...http://docs.djangoproject.com/en/dev/topics/testing/#django.test.clie...
>
> ... how do we test with HTTPS turned on? This doesn't work:
>
> client.get('/yo/', {}, HTTPS='on')
Of course the answer is that Django test client uses WSGIRequest,
which checks for "wsgi.url_schem
Hi,
I am a brand newbie learning how to use django with python (using
progresql). I am also not very experienced with packages. However, I have
been trying to follow the tutorial on djangoproject.com and I have been
having a problem with psycopg2
I had been having problems installing in general
On May 27, 10:51 am, Nuno Maltez wrote:
> > ImportError: No module named mvc
>
> What's the "mvc" module? Python can't seem to find it. Is it in your
> python path?
My project is called seoconquer.
My app is called mvc.
My absolute directory path to mvc is /home/seb/MAIN/seoconquer/mvc.
I have /
Hello Django Users
I'm a beginner going through the tutorial. I do have a problem using
the admin interface.
I can't add new records. Save results in: http://dpaste.de/UoBH/
If I'm using the shell, everything works fine: http://dpaste.de/q5O0/
I'm using 1.2.1 and the dev server. I tried different
On May 28, 8:35 am, Chris Seberino wrote:
> On May 27, 10:51 am, Nuno Maltez wrote:
>
> > > ImportError: No module named mvc
>
> > What's the "mvc" module? Python can't seem to find it. Is it in your
> > python path?
>
> My project is called seoconquer.
> My app is called mvc.
> My absolute dir
On May 28, 6:27 am, mojito wrote:
> > > When I come to deploy my django app on Apache , I get this error.
>
> > > [error] [client 127.0.0.1] Target WSGI script not found or unable to
> > > stat: C:/wsgi-django-app
> > > /testing/apache/django.wsgi
>
> > This will occur where the user that the A
On Thu, May 27, 2010 at 12:22 PM, chr wrote:
> On May 27, 11:46 am, Lee Hinde wrote:
> > So, if I were to display a list of notes, how would I join those two
> > together?
>
> if i get you right, you could accomplish this by using a model method
>
> get_weather(self):
> weather = Weather.object
On Thu, May 27, 2010 at 5:44 PM, Lee Hinde wrote:
> weather =
> Weather.objects.filter(weather_date=self.target_date,zip_code=self.created_by.store.zip_code)
>
>
so, the solution was
def get_weather(self):
weather =
Weather.objects.filter(weather_date=self.target_date,zip_code=self.cr
Just be careful with the index errors. If you are sure that this query will
allway have at least one item, so this is fine. But if it returns an empty
queryset, so you will have trouble with IndexError.
Atenciosamente,
Vinicius Mendes
Solucione Sistemas
vinic...@solucione.info
On Thu, May 27, 20
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
messages. That didn't turn
Needing to get this done, I went with SQL. The sql seems rather
inefficient. But, my data set will be rather small. I posted what I
went with on Pastebin: http://pastebin.com/VmiYNXan (good for 24
hrs).
I don't have much data loaded (just one tournament). But, you can see
the resulting table
On Thu, May 27, 2010 at 2:00 PM, dmitry b wrote:
> So, no one is running automated tests?
I'd added a patch that adds the --noinput option to testserver command:
http://code.djangoproject.com/ticket/12619
~Rolando
--
You received this message because you are subscribed to the Google Groups
"D
Yea, I just discovered that...
On Thu, May 27, 2010 at 9:10 PM, Vinicius Mendes wrote:
> Just be careful with the index errors. If you are sure that this query will
> allway have at least one item, so this is fine. But if it returns an empty
> queryset, so you will have trouble with IndexError.
On Friday 28 May 2010 10:20:55 darren wrote:
> Needing to get this done, I went with SQL. The sql seems rather
> inefficient. But, my data set will be rather small. I posted what I
> went with on Pastebin: http://pastebin.com/VmiYNXan (good for 24
> hrs).
>
> I don't have much data loaded (jus
Hi;
I've appreciated the sample apps out there as great learning tools.
I'm having problems saving existing records (new ones get created instead?)
and with validation. But rather than pepper the group with my ?s, I'd like
to do some more code reviews.
So, I'm wondering if you can recommend one
I just realized, that I'm using python 2.4.4 which is not the latest,
but within the django requirments.
Thank you!
Philipp
--
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
On Thu, May 27, 2010 at 7:13 PM, Philipp wrote:
> Hello Django Users
>
> I'm a beginner going through the tutorial. I do have a problem using
> the admin interface.
> I can't add new records. Save results in: http://dpaste.de/UoBH/
> If I'm using the shell, everything works fine: http://dpaste.de
On Fri, May 28, 2010 at 2:11 AM, Karen Tracey wrote:
> Workarounds for you prior to getting a fix into Django would be to get rid
> of the standalone hashlib that's apparently installed, or use a more recent
> level of Python.
>
...or use an older (e.g. 1.1.2) level of Django is the other option
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
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
53 matches
Mail list logo