Is it possible to order a queryset by a custom field?
I have several programmatic generated fields and need to sort the
display by them, is this possible?
Thanks
John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
As far as i know, select_related doesn't work across reverse
relationships. Sometimes it's possible to just query the base model to
achieve the same results, but not always.
Maybe its a good feature for the query.py rewrite, but i'm thinking it
could get ugly pretty fast. It would require a new
Great stuff again Malcolm. Perhaps it should be rehashed a bit and put
in the newforms docs under 'custom validation' ?
Just a thought :)
regards,
Simon
On May 22, 12:11 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2007-05-21 at 14:00 -0500, Tim Chase wrote:
> > > What is the
BTW, That did it!
I copied the code from the save_instance() update and fixed my
problem.
Thanks again.
John
On May 21, 7:29 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2007-05-22 at 02:14 +, John M wrote:
> > Malcolm,
>
> > Here is the traceback from line 41:
> >
Malcolm,
Thank you so much for discovering my problem, I was hoping it was the
newforms code and not mine ;-P.
Yea, that form= trick seems to work, not sure why, but it does. I've
also seen the callback one too, but that seemed rather complicated,
and I'm not much for complicated code :-
I'll
I'm building a blog using Django, and am wanting to use django-tagging
for, well, tagging.
But something isn't working right. And I haven't a clue why (yes, I'm
a beginner).
I've added the tagging app to my INSTALLED_APPS in the settings.py
file. It is located inside my project, which is also
On Tue, 2007-05-22 at 02:14 +, John M wrote:
> Malcolm,
>
> Here is the traceback from line 41:
> c:\python24\lib\site-packages\django\newforms\models.py in
> save_instance
>
> 34. opts = instance.__class__._meta
> 35. if form.errors:
> 36. raise ValueError("The %s could not be
Next time I'll RTFT (read the fliping thread) correctly :-P
Thanks Malcolm.
J
On May 21, 6:30 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2007-05-21 at 18:25 -0700, John M wrote:
> > So Malcolm, does that mean its in the devl version we could see?
>
> > J
>
> > On May 21, 5:56
Malcolm,
Here is the traceback from line 41:
c:\python24\lib\site-packages\django\newforms\models.py in
save_instance
34. opts = instance.__class__._meta
35. if form.errors:
36. raise ValueError("The %s could not be changed because the data
didn't validate." % opts.object_name)
37.
Last one, promise.
On May 21, 5:53 pm, Milan Andric <[EMAIL PROTECTED]> wrote:
> > On May 17, 5:34 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> > > [snip]
> > >http://code.google.com/p/django-template-utils/wiki/GenericMarkup
>
> Ok, I've got to be pretty close here. I went ahead and
Hi John,
On Mon, 2007-05-21 at 18:41 -0700, John M wrote:
> i am getting a key error with the following:
>
> sqlite3
>
> class Holding(models.Model):
> portfolio = models.ForeignKey(Portfolio, editable=False)
> symbol = models.CharField(maxlength=10)
> reason =
I am trying to display the table in my Choice table. However it's
error's out everytime I try to see the contents of the table.
In my python shell prompt I do the following and get the error
C:\django\mysite>python manage.py shell
(InteractiveConsole)
>>> from mysite.rugs.models import Choice
i am getting a key error with the following:
sqlite3
class Holding(models.Model):
portfolio = models.ForeignKey(Portfolio, editable=False)
symbol = models.CharField(maxlength=10)
reason = models.CharField(maxlength=200, blank=True,
null=True)
shares =
Hi guys!
I can't believe how fast are you developing Django! I had a 2 days old
checkout and was looking at current model documentation... and the
validation kept saying "'module' object has no attribute
'DecimalField'".
I was ready to give up and take a nap to clear my mind when I thought
I
On Mon, 2007-05-21 at 18:25 -0700, John M wrote:
> So Malcolm, does that mean its in the devl version we could see?
>
> J
>
> On May 21, 5:56 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
[]
> > It sounds like you want the django.newforms.formsets capability that
> > isn't on trunk
So Malcolm, does that mean its in the devl version we could see?
J
On May 21, 5:56 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2007-05-20 at 11:19 -0700, David Priest wrote:
> > I believe I have performed exhaustive research on the challenge of
> > creating forms that
On Sun, 2007-05-20 at 11:19 -0700, David Priest wrote:
> I believe I have performed exhaustive research on the challenge of
> creating forms that incorporate fields from multiple tables. I have
> not found *any* comprehensive, best-practices examples of this problem.
>
> It really quite
> On May 17, 5:34 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> > [snip]
> >http://code.google.com/p/django-template-utils/wiki/GenericMarkup
Ok, I've got to be pretty close here. I went ahead and created an
empty app with just a template tags directory mmtags/templatetags/
mm_markup.py ...
I believe I have performed exhaustive research on the challenge of
creating forms that incorporate fields from multiple tables. I have
not found *any* comprehensive, best-practices examples of this problem.
It really quite surprises me, as any web application of even moderate
complexity
On 07-May-18, at 6:33 AM, Malcolm Tredinnick wrote:
>
> On Thu, 2007-05-17 at 20:08 -0700, David Priest wrote:
>> It occurs to me that were I able to write the following:
>> models_list = (
>> 'project.app1.models.Claim',
>> 'project.app2.models.Vendor')
>
> Why
After bashing at it some more, I had to conclude I was out to lunch.
It is killing me to wait for newforms. It's senseless for me to
learn old forms, but I'm having a helluva time making heads or tails
of newforms. Some things that I swear must be common as mud -- like
a form that sends
On 5/21/07, ZebZiggle <[EMAIL PROTECTED]> wrote:
>
> UPDATE Content SET voteTotal = voteTotal + 1 WHERE id = ...
>
> Anyone have any thoughts on the problem? What am I missing?
I've thought about this before; IMHO, the right solution is to provide
an easy syntax for a Django query (or in this
On 5/21/07, jj <[EMAIL PROTECTED]> wrote:
> Wouldn't it be cool if generic views supported add/change out of the
> box, and the only code to write was a 1-liner equivalent to admin's
> "fields=(...,)"? Could the current admin rewrite be the occasion to
> factor out this functionality and make it
On 5/21/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote:
>
> hey everyone,
>
> I successfully cut up my models.py into different files, so now I have:
...
> to make things simpler. In all my models I have:
>
> class Meta:
> app_label = 'myapp'
>
> Now I have one problem: my
On Mon, 2007-05-21 at 14:00 -0500, Tim Chase wrote:
> > What is the "general way" to add your own validation to forms under
> > the newforms framework?
> >
> > Subclassing and adding in your clean_* methods? Using decorators or
> > the such around existing validation? Adding your own custom
[Apologies if this appears twice. I think Google ate my homework the
first time.]
On Mon, 2007-05-21 at 14:00 -0500, Tim Chase wrote:
> > What is the "general way" to add your own validation to forms under
> > the newforms framework?
> >
> > Subclassing and adding in your clean_* methods? Using
On Tue, 2007-05-22 at 08:11 +1000, Malcolm Tredinnick wrote:
> On Mon, 2007-05-21 at 14:00 -0500, Tim Chase wrote:
> > > What is the "general way" to add your own validation to forms under
> > > the newforms framework?
> > >
> > > Subclassing and adding in your clean_* methods? Using decorators
On Mon, 2007-05-21 at 19:17 +, Val wrote:
>
> DEFAULT_DIRECTORY_INDEX_TEMPLATE = """
> www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> http://www.w3.org/1999/xhtml; xml:lang="en" lang="en">
>
>
>
>
> Index of {{ directory|escape }}
>
>
> Index of {{
On Mon, 2007-05-21 at 06:07 -0700, sandro dentella wrote:
> well, ok. It's the utf-8 encoded version of u'F\xf2' I imagine. But
> why if I change DEFAULT_CHARSET
> to ' latin-1' it does not get encoded in 'latin-1'? is the db
> encoding winning over DEFAUL_ENCODING?
I don't know how many times
On May 18, 1:59 am, Milan Andric <[EMAIL PROTECTED]> wrote:
> On May 17, 5:34 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> > [snip]
> >http://code.google.com/p/django-template-utils/wiki/GenericMarkup
>
> Thanks alot for writing this, it was a sinch to get going.
>
> Now I have a def
Oops - I didn't read far enough in the DB API!
Q objects do exactly this!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
On Mon, 2007-05-21 at 13:22 +, waylan wrote:
> Mmm, good things come to those who wait. It's nice to see this finally
> come through. Thanks for all the hard work.
>
> Btw, it looks like there is a small bug in the docs [1]. Just add a
> couple tildes to the DecimalField section header (line
After looking at http://code.google.com/p/django-registration/:
forms.py
[...]
def clean_username(self):
"""
Validates that the username is not already in use.
"""
if self.cleaned_data.get('username', None):
try:
user =
All,
BravoLog is looking to hire contract a team of django developers and a
couple of team leaders to work on our application, a record-keeping
and social networking service for pilots and aircraft owners. We have
a great opening that just came up for a lead development position,
responsible
Right on the money Martin! Thanks alot.
I knew it was something *stupid* I had done, but after looking at the
project for so long, you lose your clarity for details :/
On May 21, 8:30 pm, "Martin Glueck" <[EMAIL PROTECTED]> wrote:
> Looking at the urls pattern reported in the 404 page it looks
DEFAULT_DIRECTORY_INDEX_TEMPLATE = """
http://www.w3.org/1999/xhtml; xml:lang="en" lang="en">
Index of {{ directory|escape }}
Index of {{ directory|escape }}
{% for f in file_list %}
{{ f|escape }}
{% endfor %}
"""
What exactly
Is Mark Warren's Ultimate Wealth Package Worth the Money?
You could go take a college course in marketing or entrepreneurship at
your local university or community college and spend thousands of
dollars. I took a course called Principles of Marketing.
http://2site.com/cnrqev
"Legitimate"
> What is the "general way" to add your own validation to forms under
> the newforms framework?
>
> Subclassing and adding in your clean_* methods? Using decorators or
> the such around existing validation? Adding your own custom Field
> objects and setting their "clean" methods?
My
I've got some models that look something like this:
class Entry(models.Model):
text = models.TextField()
class SubEntry(models.Model):
text = models.TextField()
sub_entry = models.ForeignKey(Entry)
class SubSubEntry(models.Model):
text = models.TextField()
sub_sub_entry =
I've got this in my Apache httpd.conf:
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/var/www/dev.django.exampleurl.co.uk/'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On
I also have this set up in my
Hi,
On Mon, 21 May 2007 06:11:52 +1000, Malcolm Tredinnick wrote:
> You're probably going to have to look at the ModelBase.__new__ method
> and work in nicely with that as well. Django's model creation metaclass
> stuff is fairly key to how things work.
>
> You might want to read the
Looking at the urls pattern reported in the 404 page it looks like there is
twice the "^" symbol.
And I would say that is the problem because this symbol tries to match the
"start of a line", so the pattern
"^news/ ^/(?P[a-zA-Z0-9-_]+)/?$" will never match to "/news/hello/".
my guess is that you
Hmm, I suppose another approach and possible horrible hack might be:
1. Create a queue of updates to the Content object
2. Votes are appended to the queue and immediately added to the
UserContentRelationship table.
3. A separate thread processes the queue periodically to ensure atomic
updates to
Hehe, this is getting old, but still things don't work.
There's no special stack trace here, I only get returned a 404 page
result for the list_detail page.
here's the full urls.py:
from django.conf.urls.defaults import *
from myproj.news.models import Entry
news_list_info = {
I have a form that allows users to submit their name and email address
for an invitation.
I do not want people signing up more than once. The following code
works, but it does not seem like the "Best Practice" solution.
forms.py
[...imports...]
class RequestInvite(forms.Form):
name =
Okay.. solved my issue... but ran into another one.
Rows are returned - however output is returned with no Keys
looks like this [(4, 2, 'ACT', 3, 'Chris', 'Yiu'), (2, 2, 'ADM', 1,
'Robert', 'Chan')]
Anyone have any thoughts on how to get the keys?
On May 21, 11:35 am, Roboto <[EMAIL
Yes, this is yet another voting design discussion.
As far as I can see there are two approaches:
1. A separate table that records the User-Content relationship
including the vote -1/0/+1
and, optionally:
2. A voting field in with the content that gets atomically updated
with each vote.
Just
Thanks,
Yes this was true indeed!
In any event, I've had to resort to using a custom SQL statement to
solve my issue. Although, I know the query works (tested in psql),
and nothing is crashing, but I'm not getting any output from the
system... it's quite odd actually... I don't know why just
Great ideas! Thanks Kelvin. I'll definitely try it out and post the
results here,
robo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Mmm, good things come to those who wait. It's nice to see this finally
come through. Thanks for all the hard work.
Btw, it looks like there is a small bug in the docs [1]. Just add a
couple tildes to the DecimalField section header (line 188??).
[1]:
One of the best features of Django admin is the ability to add and
edit objects without writing any code OR template. However, no such
built-in functionality on the non-admin part of the site. Everyone has
to reimplement it on its own, which is cumbersome and difficult to get
right or as good.
well, ok. It's the utf-8 encoded version of u'F\xf2' I imagine. But
why if I change DEFAULT_CHARSET
to ' latin-1' it does not get encoded in 'latin-1'? is the db
encoding winning over DEFAUL_ENCODING?
sandro
*:-)
oh, i'd like to be an ascii speaking... ;-)
hey everyone,
I successfully cut up my models.py into different files, so now I have:
models/
+ something1.py
+ something2.py
+ something3.py
and in __init__.py
from something1 import *
from something2 import *
from something3 import *
to make
After some weeks of relative good relationship with unicode I met a new
problem. Digging into it I see things I cannot understand and I'm not sure
how these are related to my problem.
I'm using postgresql, psycopg2, DEFAULT_CHARSET='utf-8', db encoding unicode.
In [1]: from
Hi all
Now you can get paid to surf ads..All you need to do is register on
their site, surf ads for 30 seconds.
And you will be credited with the earning immediately. Ist'nt dat
amazing. Many of you must have already joined, for rest dont
wait...hurry up...
Sooner you join more you earn
You might want to look into generating some sort of cron file from
within the framework. Writing a plaintext file is not that hard. Maybe
just write it somewhere within your project folder and make cron
"include" it, though I'm unsure wether cron is able to do such an
include/import with the
I found out the "sqlcustom" feature in manage.py and also new PostgreSQL
server supports setting inheritance through ALTER TABLE command, so this
solves my problem :)
Sebastjan
On 5/21/07, Sebastjan Trepca <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I use PostgreSQL for database backend and its
On 20.05.2007., at 17:04, Christian M Hoeppner wrote:
> mod_python holds code in memory, just like mod_perl. This makes
> things go a
> whole lot faster. FCGI is the "traditional" way of doing things.
> For every
> request a new call (and perhaps a new spawn) is made to the fcgi
> binary.
I m still not able to get a proper django SQL query for the same...I
used the above query but it says somedb.Objective table doesnt exist
i m a newbie to django...and m not able to get hold of this "extra"
api provided by the django
-Brij
--~--~-~--~~~---~--~~
Hi All,
I just found a link which seems to be quite informative about CRM.
Just try the link below to have a look at it.
http://www.quazen.com/Business/Management/Introduction-to-CRM.25530
This contains the basics of CRM. I really loved this article.
Thanks,
Ankur
On 3/14/07, Derek Lee-Wo <[EMAIL PROTECTED]> wrote:
>
> Amazon shows that the book on Django will be published on March 26th
> which is 1 1/2 weeks away. Does anyone know if that date is still
> valid?
>
> I'm anxiously waiting to order it.
Uhm.. I think they will wait until Django 1.0 hits the
On 5/21/07, Sebastjan Trepca <[EMAIL PROTECTED]> wrote:
> I just started to use generic relations and I was wondering why are the
> default field names "object_id" and "content_type" and not "object_id" and
> "object_type"?
> Seems better that way and more logical ... or is it?
I would guess
add another function:
def get_fields(self):
return self.color, self.size, self.price
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Hi,
I just started to use generic relations and I was wondering why are the
default field names "object_id" and "content_type" and not "object_id" and
"object_type"?
Seems better that way and more logical ... or is it?
Thanks, Sebastjan
--~--~-~--~~~---~--~~
You
64 matches
Mail list logo