Hello,
I have the following code 's2 = s.sandp.all()' When I do a 'assert
False, s2' I get the following:
[, )>, , )>, , )>, , )>]
I want to be able to sort the list by the Price.
///
I tried the following code
s2 = s.sandp.order_by('price')
assert False, s2
And this is what I get:
Hello guys
I m looking for a library or a scrip that autolinks html + non html
content such as
i love...
Spin the bottle
Redneck hoe
http://den.com;>A
http://www.google.com loves ICP songs
and the result should be
i love...
Spin the bottle
Redneck hoe
http://den.com;>A
Hello
I have nullable foreign keys in my model and would like to change the
display value of some of them to things like 'unknown' or 'NA' in my
forms. How do I do this. I am not using the admin screens at the
moment.
Thanks
Catriona
--~--~-~--~~~---~--~~
You
Hello
I have nullable foreign keys in my model and would like to change the
display value of some of them to things like 'unknown' or 'NA' in my
forms. How do I do this. I am not using the admin screens at the
moment.
Thanks
Catriona
--~--~-~--~~~---~--~~
You
this will work only for case if some_field is blank=True,null=True. in
any other case it will fail at f.save(commit=False) because of invalid
form data (some_field is empty and still required)
Nathaniel Whiteinge пишет:
> Your best bet is probably to use ``save(commit=False)`` [1]_ to get a
>
A simplified version of model is this:
class Category(models.Model):
category = models.CharField(maxlength=100)
class Program(models.Model):
name = models.CharField(maxlength=100)
category = models.ForeignKey(Category)
class Message(models.Model):
program =
On 19-Sep-07, at 12:38 AM, Chris Brand wrote:
>> and one to run django on. (I believe I had to run 2.3 and 2.5) It can
>> make configuration for deployment to be a bit of a pain.
> I've had no such problems with my Fedora Core 6 box. Just installed
> everything using yum and it worked fine. I
We use RHEL4 in our datacenter. I've used ubuntu, debian and CentOS 5
on development servers. Choice of Redhat was based on what other boxes
were running on before I arrived. I do indeed need to install
separate packages for python and postgresql.
So far it's been near zero maintenance after
On 9/19/07, jacoberg2 <[EMAIL PROTECTED]> wrote:
>
> Hey, I am trying to read a string from a file and then save it to the
> database. In doing so I get the error message 'str' has no attribute
> 'strftime'. the string is a a dat that i am trying to save to the
> datetimefield in my database. The
Hi Ian
In my model, I have specified db_table = "Survey" so I don't think
that is the problem
I'll have another play with it and see if I can get further.
Thanks
Catriona
On Sep 19, 9:50 am, Ian <[EMAIL PROTECTED]> wrote:
> I'm unable to reproduce the error you're getting. The default table
>> I looked over the docs
>> http://www.djangoproject.com/documentation/0_91/templates/
>>
>> but the closest thing was SPACELESS
>
> - What does a TRIM filter do? Perhaps it change the colour of the trim
> on your website?
I suspect what some languages call Trim is the Python
function/method
On 9/19/07, James <[EMAIL PROTECTED]> wrote:
>
> You matter-of-factly suggest that a ValuesQuerySet is as good as
> QuerySet. However, the ValuesQuerySet has some fundamental
> limitations. In particular, the ValuesQuerySet does not have
> attributes corresponding to the fields in the QuerySet.
I have a shared hosting account at my current host with shell access,
and I have my own python installation at ~/python which works fine for
plain cgi programs. I'm pretty sure my host doesn't have mod_python
but they're using litespeed web server so I thought fcgi would work. I
copy+pasted the
On 9/19/07, olivier <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> Is there a way to switch django's relationship building from INNER
> JOIN to LEFT OUTER JOIN ?
> It causes unexpected behaviour when filtering on both parent and child
> tables.
Not really. There is a limited ability to control the
On 9/19/07, Frank Peterson <[EMAIL PROTECTED]> wrote:
>
> I looked over the docs
> http://www.djangoproject.com/documentation/0_91/templates/
>
> but the closest thing was SPACELESS
>
> I tried to use it like this:
> {% block data %}{% spaceless %}{{ story.tease }}{% endspaceless %}{%
> endblock
I'm unable to reproduce the error you're getting. The default table
name would be app_survey rather than just survey, where app is the
name of the application, so you might check that the table you listed
is the same table that Django is using.
Hope that helps,
Ian
On Sep 18, 5:03 pm, Catriona
Hi Ian
Sorry I should have given you this info.
I am using Python 2.5.1 and Django 6051.
I get the following when I run a describe on the table - sorry it is a
bit messy
Object Type TABLE Object SURVEY
Table Column Data Type Length Precision Scale Primary Key Nullable
Default Comment
QUER GANHAR MUITO DINHEIRO?
GENTE FUNCIONA DE VERDADE.. EU FIZ UMA VEZ.. JÁ TÔ
FAZENDO DENOVO
VAMOS NOS AJUDAR...FUNCIONA!!!
Olá... pessoal, a seguir está todo o relato de um programa que está
mudando a vida de muita gente através da internet... o programa é
honesto, constitucionalmente
On 9/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I have an app (0.96 so no select_related) that had a large initial
To be clear, select_related has existed for quite a while in Django --
0.91 at least.
> I got a lot of mileage by caching just in a dictionary
> the foreign keys so
I've been tinkering some more on this project and added on the fly
image editing via snipshot.com as well as preliminary support for
browsing and inserting YouTube videos
http://code.google.com/p/django-admin-uploads/
--
Pete
--~--~-~--~~~---~--~~
You received
I have an app (0.96 so no select_related) that had a large initial
data load consisting of a couple core tables and several foreign key
relationships. I got a lot of mileage by caching just in a dictionary
the foreign keys so that the ORM wasn't doing lots of redundant
queries. I found the same
> Between caching, profiling, and having a good sense of what your
Profiling...the #1 thing to do.
Without profiling the app under "normal usage" (common actions &
browsing patterns gleaned from the current deployment) scaled to
high loads, you're just twiddling knobs and wasting time.
If
On Sep 18, 11:06 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I want to say one word to you. Just one word.
>
> http://en.wikipedia.org/wiki/Denormalization
That's the word I'm familiar with :)
I'm using it, but not as often as I probably should.
So in your opinion Djano's ORM is good
I want to say one word to you. Just one word.
http://en.wikipedia.org/wiki/Denormalization
On Sep 18, 10:57 pm, yezooz <[EMAIL PROTECTED]> wrote:
> On Sep 18, 10:34 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote:
>
> > Without knowing a hell of a lot more of the details of you site, what
> >
On Sep 18, 10:34 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote:
> Without knowing a hell of a lot more of the details of you site, what
> you're trying to do, etc - nobody can reasonably answer this question.
> The ORM is fine, but if it's not as fast as you need for certain
> queries, you can
Without knowing a hell of a lot more of the details of you site, what
you're trying to do, etc - nobody can reasonably answer this question.
The ORM is fine, but if it's not as fast as you need for certain
queries, you can always drop back to RAW sql to see if that will give
you speed. At the
On Sep 18, 10:23 pm, yezooz <[EMAIL PROTECTED]> wrote:
> On Sep 18, 10:14 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote:
>
> > two words: intelligent caching
>
> > Know what you're asking for commonly, and cache it up with memcache.
> > That will do you a world of benefit.
>
> Well of course
Thanks very much for your help Doug. Do you think there is value in
having a generic DAG implementation for Django? Seems to me like it
might be a useful addition, but I'm curious as to how useful it would
be given that most non-Django implementations I have come across are
as you describe 'very
On Sep 18, 10:14 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote:
> two words: intelligent caching
>
> Know what you're asking for commonly, and cache it up with memcache.
> That will do you a world of benefit.
Well of course caching will solve some of the problems, but cache
still needs to
You matter-of-factly suggest that a ValuesQuerySet is as good as
QuerySet. However, the ValuesQuerySet has some fundamental
limitations. In particular, the ValuesQuerySet does not have
attributes corresponding to the fields in the QuerySet. This makes a
ValuesQuerySet completely useless in a
two words: intelligent caching
Know what you're asking for commonly, and cache it up with memcache.
That will do you a world of benefit.
-joe
On 9/18/07, yezooz <[EMAIL PROTECTED]> wrote:
>
> hi all,
>
> I'm sure many of you run high traffic websites in Django and I'm very
> curious how you're
Yups, sorry, the query would be build with Q objects :
Q(title__icontains = 'cooking') | Q(collection__name__icontains =
'cooking')
But the JOIN problem remains.
Olivier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Hi all,
Is there a way to switch django's relationship building from INNER
JOIN to LEFT OUTER JOIN ?
It causes unexpected behaviour when filtering on both parent and child
tables.
For instance, let's say my models are :
class Collection(model):
name = CharField()
class Book(model):
title
hi all,
I'm sure many of you run high traffic websites in Django and I'm very
curious how you're avoiding performance hit caused by built-in ORM.
Select_related not always working and it's still might generate dozens
of select's.
Are you just running custom SQL queries with joins ?
greetings
Justin Lilly wrote:
> Actually there is a reason why debian based OS's are preferred (in my
> opinion). Having installed Django on CentOS, I found that you have to
> run two concurrent versions of python. One for the OS and its tools
> and one to run django on. (I believe I had to run 2.3 and
I looked over the docs
http://www.djangoproject.com/documentation/0_91/templates/
but the closest thing was SPACELESS
I tried to use it like this:
{% block data %}{% spaceless %}{{ story.tease }}{% endspaceless %}{%
endblock %}
But it didnt work.
You mean an error telling you that you need to set the
DJANGO_SETTINGS_MODULE environment variable? Or something else?
os.environ['DJANGO_SETTINGS_MODULE']='mysite.settings'
right at the top of your script (after the #! and the import for os ;) )
should solve this.
Then you should probably
Catriona,
What versions of Python and Django are you using?
What output do you get from running a describe on the Survey model's
table?
Ian
On Sep 17, 5:07 pm, Catriona <[EMAIL PROTECTED]> wrote:
> Hello
>
> I'm a newbie to Django and Python so sorry if this is a dumb mistake
> on my behalf.
>
Hi,
If we have the models models.py:
from django.db import models
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice =
Come on lets Join us !! Clubzuzu.
www.clubzuzu.com
Meet your perfect match
Looking for an easy, fun, and safe way to meet friends, dates,
lovers ,partners of your dreams? You have come to the right place!
www.clubzuzu.com.
Here's the best part, it's FREE to join.
As a member, you can search
ola,
am i glad that people like you exist!!...you explained things just
fine and your code works like a charm
regards
Ian
On 9/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> You can not do what you are trying to do, the way you are doing it ;-)
>
> The problem is the 'test_name' does
I find I can use django users and groups to authorize apache locations and
directories using a modified version of modpython.py(I just hacked it to check
for required groups).
I have some difficulties with this simple scheme.
First off it seems to be completely separate from the normal django
MyModel._meta.verbose_name
On 18 сент, 20:31, Rob Slotboom <[EMAIL PROTECTED]> wrote:
> For a class method I want to use the value of the
> Model>Meta>verbose_name.
> Can someone tell me how to get this value?
>
> Thanks, Rob
--~--~-~--~~~---~--~~
You received
Rob Slotboom wrote:
> For a class method I want to use the value of the
> Model>Meta>verbose_name.
> Can someone tell me how to get this value?
>
> Thanks, Rob
You almost had it:
Model._meta.verbose_name
Jonathan.
--~--~-~--~~~---~--~~
You received this
Tim,
Thanks for taking a look. Still feeling my way on what I need to post
to be most helpful.
The OS is Ubuntu 7.04 (Feisty).
Here's the full traceback:
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py"
in get_response
77. response =
For a class method I want to use the value of the
Model>Meta>verbose_name.
Can someone tell me how to get this value?
Thanks, Rob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
Hey, I am trying to read a string from a file and then save it to the
database. In doing so I get the error message 'str' has no attribute
'strftime'. the string is a a dat that i am trying to save to the
datetimefield in my database. The parser i used returned a string but
hen it tries to save
> However, when I save the record in the Django admin, I get this:
>
> [Errno 25] Inappropriate ioctl for device
>
> Exception Location: build/bdist.linux-i686/egg/twitter.py in
> _GetUsername, line 1498
A couple pieces of information would be helpful:
Which OS?
Could you provide the
Robo,
The particular view I was describing returns a jsonified dictionary that
(if all goes well) contains a form, a history table, and a messages table.
If things do not go well, it will return either a jsonified dictionary
containing either an error or a login_error depending on what went
I'm trying to marry up Django and a python wrapper to the Twitter API
called Python-Twitter (http://code.google.com/p/python-twitter/) to
trigger a status change on saving an item to a database. It looks
something like this:
def save(self):
if self.makepublic:
api =
Hi Richard,
I think I got the idea of your view. What I'd like to see is an
example of your template and javascript to see how you are accessing
the json data.
Thanks a lot,
robo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Actually there is a reason why debian based OS's are preferred (in my
opinion). Having installed Django on CentOS, I found that you have to run
two concurrent versions of python. One for the OS and its tools and one to
run django on. (I believe I had to run 2.3 and 2.5) It can make
configuration
Thanks for the speedy reply and your diagnosis was absolutely spot on.
Purely as an aside and because there may be others in my situation,
the cause of the error was a confusion between thinking in django
terms (where a foreign key is actually a python object) and in sql
terms where a foreign key
On 9/18/07, paulh <[EMAIL PROTECTED]> wrote:
>
> ProgrammingError at /newso/6562/80/sisale/picked/
> ERROR: current transaction is aborted, commands ignored until end of
> transaction block SET client_encoding to 'UNICODE'
>
> The last statement executed was an explicit call to ...save().
> Any special reasons debian based installs are better than
> fedora based ones?
I can't say there should be any sort of major difference once
meta-package programs were instituted for dependency tracking.
My understanding is that Yum may do this sort of thing.
I tried Red Hat early in the
Nis Jørgensen wrote:
>>
> What is the value of "username"? This is what gives you the problem, not
> "email", as indicated here:
>> IntegrityError: ERROR: duplicate key violates unique constraint
>> "auth_user_username_key"
Hello Nis,
thank you for your interest. Username is evaluated from
Hello, django users!
I am experiencing a strange behavior with our Django project on one of
the development computers.
We have such a situation where Users can be members of one or more
sharedspaces which are related to institutions.
User <- Membership -> SharedSpace -> Institution
Lately, I
I'v created a project db-dump on code.google.com, you can visit it at:
http://code.google.com/p/db-dump/
And db_dump.py is used for dump and restore database of Django. And it
can also support some simple situations for Model changes, so it can
also be used in importing data after the migration
On 18-Sep-07, at 4:32 PM, shabda wrote:
> Any special reasons debian based installs are better than fedora based
> ones?
lets not start distro wars here. It is all a matter of individual
choice - any linux/bsd flavour is fine - avoid windows and OSX for
production servers.
--
regards
kg
> function1(request):
> return function2(request)
no i just want that function2(request) call makes a permanent redirect
(not HttpResponseRedirect, i dont want more burden on urls.py) to
function2 and all the response should be sent from function2 only. it
should never come back to function1
On 9/18/07, patrickk <[EMAIL PROTECTED]> wrote:
>
> now I get:
> ImportError: No module named django.core.management
>
> the directory "django_src" is on my python-path.
>
Read cron documentation; the cronjobs run with a crippled environment
but you can set/add the env vars (PYHTONPATH in this
Dear Dushyant
I has followed your introduction,but the errors is still existing as
the following:
Traceback (most recent call last):
You basically want something like this?
function1(request):
return function2(request)
Sure, Django is "just" Python :-)
2007/9/18, Dushyant Sharma <[EMAIL PROTECTED]>:
>
> is it possible to return HttpResponse from another function
>
> like i have called a function say furnction1(request)
Better also insert it before doing this import. Your cron-manager
probably uses a different shell then your terminal :)
2007/9/18, patrickk <[EMAIL PROTECTED]>:
>
> now I get:
> ImportError: No module named django.core.management
>
> the directory "django_src" is on my python-path.
>
>
> On 18
I got this error:
ERROR: current transaction is aborted, commands ignored until end of
transaction block SET client_encoding to 'UNICODE'
from django dev version 6373. There are a couple of hits when I
searched the list, but either I didn't understand them, or they are
not relevenat (or both).
patrickk skrev:
> now I get:
> ImportError: No module named django.core.management
>
> the directory "django_src" is on my python-path.
>
It probably isn't on cron's python-path, though. Try adding
PYTHONPATH=/your/python/path
to the top of your crontab.
--
Nis Jørgensen
Who is NOT a
is it possible to return HttpResponse from another function
like i have called a function say furnction1(request) and now is it
possible
function1(request):
#normal statements
#here i call another function
function2(request)
return HttpResponse('bye') #just for
Michal skrev:
> Hello,
> I have problem with inserting duplicate rows into DB.
>
> There is registration form on my site. User fill email address together
> with additional parameters (form definition: http://dpaste.com/19959/).
> After POST it to the server, email is checked in form against
now I get:
ImportError: No module named django.core.management
the directory "django_src" is on my python-path.
On 18 Sep., 12:43, Christian Joergensen <[EMAIL PROTECTED]> wrote:
> patrickk wrote:
> > I just tried to set up a cronjob with plesk and I got this error:
>
> > from: can't read
A couple of suggestions:
1. You can put the whole array of dates JSONized into a hidden field,
parse it in the webserver and validate it's values.
2. You can create input fields dynamically using JS on the client side
and using some dynamic form mechanism on the server side, and also
have some
patrickk wrote:
> I just tried to set up a cronjob with plesk and I got this error:
>
> from: can't read /var/mail/django.core.management
> /var/www/vhosts/mydomain.at/www/scripts/cronjobs/mail_editors.py: line
> 4: import: command not found
>
> (live publicly viewable sites only)
> 1. What OS are you using to run Django on?
OpenBSD and Debian Linux
> 2. What OS do you think is most popular for running Django on?
Debian and its derivatives (Ubuntu, etc...anything using apt)
> 3. What OS do you think is most suited for running
dear Han
you must add path of python.exe, django-admin.py and manage.py to
your system path
you should avoid copying system files here and there as it will cause
problems.
clean approach should be
1. install python (say installed at C:\python25)
2. set path for python.exe
3. install django
On 9/18/07, Horst Gutmann <[EMAIL PROTECTED]> wrote:
> Did you also receive any error message when running sudo python
> setup.py install on a newly extracted folder (basically when compiling
> the C part of that module)? This looks to me like mysql_config wasn't
> found. If you've installed
> We're always open to documentation improvements; thanks for offering to help.
The latest version (under revision before becoming HTML) of my
'absurdly simple' try-Django-locally for OS X is here:
ecoconsulting.co.uk/python/django-install.txt
> If you're installing from a downloaded version of
I just tried to set up a cronjob with plesk and I got this error:
from: can't read /var/mail/django.core.management
/var/www/vhosts/mydomain.at/www/scripts/cronjobs/mail_editors.py: line
4: import: command not found
/var/www/vhosts/mydomain.at/www/scripts/cronjobs/mail_editors.py: line
5: syntax
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/django/core/handlers/
base.py", line 77, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/llcom/projects/llcom/makeav/views.py", line 231, in
create_avatar
return
You can use the multi-db branch as is and use it for a different app for
each db if you want as per the instructions. However you'll lose a lot of
the recent functionality from trunk that way. I'd suggest checking out trunk
at r 6100 and then patching against that. Contact me off list and I'll
On 18 Sep 2007, at 5:01 am, antonio von carmoducci wrote:
> (live publicly viewable sites only)
> 1. What OS are you using to run Django on?
Debian
> 2. What OS do you think is most popular for running Django on?
Debian or Ubuntu, I imagine.
> 3. What OS do you think is most suited for
Hello,
I have problem with inserting duplicate rows into DB.
There is registration form on my site. User fill email address together
with additional parameters (form definition: http://dpaste.com/19959/).
After POST it to the server, email is checked in form against DB. If
user with same
On Sep 17, 11:00 pm, "Ben Ford" <[EMAIL PROTECTED]> wrote:
> Hi Mike,
> There is a branch that supports multiple databases in the repository. It's
> quite out of date in the SVN repo but Koen put in some stirling work over
> the period of the sprint and produced a patch against trunk at around
Did you also receive any error message when running sudo python
setup.py install on a newly extracted folder (basically when compiling
the C part of that module)? This looks to me like mysql_config wasn't
found. If you've installed mysql in a non-standard place (like for
example MacPorts does),
82 matches
Mail list logo