Wow ... that article is so good, it needs to be part of the standard
Django docs.
--~--~-~--~~~---~--~~
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.co
Karen officially rocks.
Thanks!
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to
Upon further research ... I'm suspecting I need to create a Manager
and override get_query_set(), but since I don't have a request object,
I can't get the currently logged in user.
Is there a recommended approach to this for the dev stream?
-Z
--~--~-~--~~~---~--~
Hi,
I have two Model classes:
class Opportunity(models.Model):
rep = models.ForeignKey(User)
...
class Deal(models.Model):
opportunity = models.ForeignKey(Opportunity)
...
I want to limit the admin UI so that users can only see Opportunities
and the related Deals they own. If they a
Hi all,
Sorry for the cryptic subject line, but I don't know how else to
describe it.
I have two tables:
class Opportunity(models.Model):
...
class Deal(models.Model):
opp = models.ForeignKey(Opportunity)
...
However, in the admin, I want the user to enter the data for the
Opportunity a
Cool, looks like a promising start. I'm working with Ning tech support
to see what's happening (seems to be a slow .css loading). So, if they
can't resolve, I'll load pinax.
Out of curiosity, how many people are working on Pinax?
Thanks for quick response!
-Z
--~--~-~--~~---
Hi, for a new project I'm working on I had planned on using Ning as
the community holder and then using Django to make widgets to fit
inside. But I find that Ning is painfully slow to the point that it's
unusable (anyone else found this)?
That said, I think I need to go another route.
Can anyone
Hi all!
I'm seeing a really strange behavior.
I have a query
q = Company.objects.filter(asOf__isnull = False).filter(Q(exchange =
1) | Q(exchange = 2)).order_by("name")[1:50]
When I run it from the command prompt, it gives proper results.
But when I run it as the web application / view, the s
Thanks Karen ... do you of a way to override this behavior?
I can think of many situations where you would want to be able to
modify it.
-Z
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
I'm having the same/similar problem. I have a field
created = models.DateTimeField(auto_now_add = True)
which doesn't show up in the admin interface, but everything else
does ... including other datetime fields (just not auto_add_now).
The field exists in the database, is used and getting p
I need a good comment/forum library, ideally with Karma/Blocking/
Voting/etc to integrate with my django project.
I've looked at PHPBB and vbulletin which are good, but I can't stand
PHP.
Any suggestions?
Anyone interested in making a Django side project for this?
-Z
--~--~-~--~~
Upgraded mod_python to latest version and upgraded python 2.4.x ...
problem gone away.
Go figure.
Thanks all!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
This gets even more weird.
I copied the send_mass_mail() code from django.core.mail into my
module so I could orchestrate it.
I changed the DNS_NAME lookup to a hardcoded string and then got the
15s delay on the smtplib.SMTP(settings.EMAIL_HOST,
settings.EMAIL_PORT) line?!
So, perhaps the cache
On Jun 25, 11:55 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> (for example, a setting for the fqdn so that we don't even do the lookup
> if the setting exists).
I like that idea. I should be able to just set DNS_NAME myself from
the calling module.
Let me investigate.
Thx guys,
Sandy
-
Howdy!
Emails were taking 15s to send each. Upon investigation it came down
to CachedDnsName in django.core.mail. Specifically, the
socket.getfqdn() call. Also, it *always* happened, not just on
startup. So it seems the call was timing out and the cache wasn't
effective.
The strange part is, it
Actually ... scratch that last point ... my bad. I think I'm onto the
solution and the above query seems fine.
But there's definitely a django bug in there somewhere. I'll submit it
later.
--~--~-~--~~~---~--~~
You received this message because you are subscribed
Yes, and it gets worse. I changed my query to be:
ticks = list(StockTicker.objects.filter(exchange = 1) \
.extra(where = ["symbol = '@Gold' AND moment >= '%s' AND
moment < '%s' " % (postgresDate(start), postgresDate(end))]) \
.order_by('moment'))
(which works dire
Further investigation ... the sql looks good I think:
...
FROM ...
WHERE ( ...
AND "igapp_stockticker"."moment" < 2007-06-14 05:00:00
AND "igapp_stockticker"."moment" >= 2007-06-13 05:00:00)
Is there some special markup required for postgres to utilize the time
info?
Baffled.
PS> Yes, the data
Howdy!
Starting with something like this:
start = 9pm on Monday
end = 3am on Tuesday
table.objects.filter(moment__range=(start, end))
Only brings back data until midnight on Monday.
Shouldn't range use the time component of a datetime?
Am I missing something?
Thx in advance,
Sandy
--~--~-
Super ... thanks Malcolm!
I'll start later today.
-Sandy
PS> Congratulations ... looks like a great addition.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send emai
Hi, I'm really stuck on a bug (decode exceptions on attempting to save
utf-8 to postgres text fields) and suspect I'm going to need the
unicode branch to solve it. But I have some questions:
1. When is it likely that this branch will be merged with trunk?
2. How would you rank the stability of t
If your focus is on images, I can't recommend this utility strong
enough:
http://www.aurigma.com/
I believe Facebook uses it and I have no relation to it.
It's a client-side compression utility for images and it supports a
Java / ActiveX client model ... whatever works.
Of course, you need to
Here's a nice softball question for a Friday afternoon ...
What is the average going rate for seasoned Django developers? Hourly
rates or annual salaries are fine.
Strong python, javascript, CSS, postgres, jquery (or alike), debugging
and lots of general experience in software development. And w
Took some custom SQL, but this works well:
content = Content.objects \
.filter(approved__isnull = False) \
.extra(where=['id not in (SELECT content_id FROM
relationship WHERE user_id = %d and "hasRead" = TRUE)' % user.id]) \
.order_by('-created')
Phew.
Joseph ... you da man!
Next time your in Halifax, Nova Scotia ... the beer is on me.
I was looking at that method and ignored it since I'm not using
transactions.
THANK YOU!
-Sandy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to t
More info ...
I wrote a little program to execute the query directly via psycopg and
it works fine. Even if I take this test code and put it in the running
django code, it continues to work fine.
The SQL is an UPDATE command, like
UPDATE
content
SET
"vote
More info ...
I wrote a little program to execute the query directly via psycopg and
it works fine. Even if I take this test code and put it in the running
django code, it continues to work fine.
The SQL is an UPDATE command, like
UPDATE
content
SET
"vote
More info ...
I wrote a little program to execute the query directly via psycopg and
it works fine. Even if I take this test code and put it in the running
django code, it continues to work fine.
The SQL is an UPDATE command, like
UPDATE
content
SET
"vote
More info ...
I wrote a little program to execute the query directly via psycopg and
it works fine. Even if I take this test code and put it in the running
django code, it continues to work fine.
The SQL is an UPDATE command, like
UPDATE
content
SET
"vote
More info ...
I wrote a little program to execute the query directly via psycopg and
it works fine. Even if I take this test code and put it in the running
django code, it continues to work fine.
The SQL is an UPDATE command, like
UPDATE
content
SET
"vote
I'm doing a very simple direct SQL call
cursor = connection.cursor()
cursor.execute(sql)
which works when I issue the SQL directly in the database, but via
django does nothing.
cursor.rowcount returns correctly, but there are no rows to fetch and
the database isn't updated.
Any ideas?
Hi all (again),
I'm hoping someone can help me with the syntax for this django
query
I have three related tables
class User(models.Model):
# stuff ...
class Content(models.Model):
# stuff ...
class Relationship(models.Model):
user = models.ForeignKey(User)
content = model
Hmm, that's interesting Russ.
So, if I understand what you are suggesting is a syntax that allows
the operation to be performed in the database and not on the server?
If the resultant sql utilizes a sub-query, that might be an issue (for
the same concurrency problems as stated above).
I think f
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
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 g
I've been using it for a couple of years now. I'm still using 3.x,
can't comment on 4.x. The debugging is pretty bad and doesn't really
work as advertised, but the editor is solid (can run into resource
leaks on low mem computers). The browser is good, the project mgmt is
good. Overall, I'm happy
I want to be able to add new elements and delete individual
elements ... can I do this with the Tabular view?
For example:
Container
Element 1 [delete]
Element 2 [delete]
Element 3 [delete]
add new Element new Container
Is there a switch for this? Current
Hey all!
I run into a problem related to this discussion.
Somehow, someway, I'm getting multiple entries in my data model where
I should only ever have one.
I suspect it's related to the users hitting the back button or double-
clicking a submit button (or something). But it baffles me how it's
Yup, adding "symmetric = False" to the model field fixed it.
Cheers,
Sandy
--~--~-~--~~~---~--~~
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
To
More on this ... it seems that django adds two entries to the join
table.
Doing:
manager.subordinates.add(employee)
added two entries:
id = 7 from = 1to = 2
id = 8 from = 2to = 1
Is this the correct behavior? I would assume only one relationship
should be added (from = 1 to = 2)
H
Anyone?
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For mo
I have a model:
class Employee(models.Model):
name = models.CharField(maxlength = 100)
reportsTo = models.ForeignKey('self', null=True,
related_name='dependent_element')
subordinates = models.ManyToManyField('self')
I want to add the employee as a subordinate when the manager is
defi
Anyone?
ZebZiggle wrote:
Hey all,
Belated Happy New Year!
I'm embarking on a new Django project (a business application vs. the
http://www.MyDarkSecret.com game of my previous effort). I'm hoping to
use the admin capabilities of Django for this project.
However, I have App A and
Hey all,
Belated Happy New Year!
I'm embarking on a new Django project (a business application vs. the
http://www.MyDarkSecret.com game of my previous effort). I'm hoping to
use the admin capabilities of Django for this project.
However, I have App A and App B both installed in the same Projec
Ah ... of course.
Thanks James!
Keep up the great work!
-Sandy
--~--~-~--~~~---~--~~
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
To unsubscr
More on this:
If I change Accusation to:
class Accusation(models.Model):
game = models.ForeignKey(Game)
player = models.ForeignKey(Player, related_name='related_player')
accusedPlayer = models.ForeignKey(Player,
related_name='related_accusedPlayer')
isCommitted = models.BooleanFi
Hi there,
I've decided to drop my old 0.91 database and rebuild, rather than try
to upgrade it. So, in my dev environment I've dropped the database, but
now when I try to 'syncdb' I get the following validation error.
Error: Couldn't install apps, because there were errors in one or more
models:
Got'cha! That worked ... I'm now converted over to 0.95!
Thanks for all of your great help Russ!
-Sandy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dj
Wow ... I had no idea about that. I must have a ton of duplicate
records in production now. (more homework).
What's the correct way to set a related object to null?
-S
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Group
Thx Russ!
>> player.user.id = None
>> player.save()
>Yes. (assuming that the desired behaviour is to create a new
> player as a result of your save)
I assume you mean that player will get a new ID, but not that I'll end
up with a duplication player record?
--~--~-~--~~
What is the format for __id in filters?
Does this code look correct (assuming characterDefinition is a member
of GameElement):
game.gameelement_set.filter(characterDefinition__id = characterId)
Note the two underscores. Also, I'm assuming gameElement_set gets
changed to lower-case "gameelement
Hey all!
I want to spawn a thread when Apache starts that will do some stuff in
the background. The thread will need to access the Django data model.
I'd really like the solution to work with the development environment
too (non-apache).
I was thinking about just using a singleton during a per-s
Sorry, got it.
I had to remove the /models directory and rename mydarksecret.py to
models.py. I thought I could just change the import, but apparently
not. Once I moved the files, it all worked ... like magic ;-)
Cheers,
Sandy
--~--~-~--~~~---~--~~
You received
Hey all!
I've got most of the heavy lifting completed in moving from 0.91 ->
0.95. But now I get the following:
ERROR: relation "models_game" does not exist SELECT
"models_game"."id","models_game"."state","models_game"."title","models_game"."summary","models_game"."method","models_game"."motive"
Yup,
was:
from django.core.extensions import XXX
now:
from django.shortcuts import XXX
thx!
-Sandy
PS> I'm sure there'll be more ... hang in there!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
Hey all!
I'm finally getting around to migrating from .91 to .95. I've done all
the grunt work from the docs and now I'm doing some quick tests ... and
running into problems. I'm sure I missed a step somewhere.
Any idea what would cause this ViewDoesNotExist exception (No module
named extensions
So it would just look like:
return render_to_response('polls/index.html/#foo', {'latest_poll_list':
latest_poll_list})
or
return render_to_response('polls/index.html#foo', {'latest_poll_list':
latest_poll_list})
Is that correct?
-Sandy
PS> Thx for the tip ... I'll change that! I'm pretty
old-
Sorry if this a really silly question everyone, but how do I jump to
named anchor with the URL mapping of Django?
I have a template that uses targets and want to go to a
specific target from another page /mypage#foo
Is this possible? If so, how?
Thx,
Sandy
--~--~-~--~~---
Hey, that's a good idea.
I was thinking about a nice addition to Django where you would keep
your old model files around and offer a few utility classes to do the
diff / alter output for you. But your idea is a nice immediate step.
Cheers,
Sandy
--~--~-~--~~~---~--~
Thx Graham ... that's what I'll do.
-Sandy
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, se
Hey!
What do most users do for upgrading production databases?
I have an upgrade I'd like to make to my game, but it will require
model changes.
I could:
1. export the whole database, drop the tables, load the new schema,
import the database
2. update just the tables that changed
either way, I
Hey everyone!
As you may or may not know (or are sick of hearing about) ... I've
been dabbling on a web-game for a while now. It's called "My Dark
Secret" and it's an online Murder Mystery Dinner Party game. You get
to participate in a murder mystery as a murderer or a suspect. Your
challenge is
haha ... thought it was going to be quoted.
I agree to keeping the payment processing as a non-django component.
I'll look at the links referred. Thx for that!
-Z
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"D
I agree completely.
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send email to [EMAIL PROTE
I have no interest in the shopping cart, shipping, etc. ... just the
checkout and credit card processing. I'll happily do the SkipJack
driver.
-Z
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" grou
How about "Reinhardt"?
Django's last name.
-Z
--~--~-~--~~~---~--~~
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
To unsubscribe from this group
Interesting ... I was looking at supporting SkipJack ... we should try
to define some common interfaces here. I just looked at the PHP code
and you're correct, it will be pretty easy to convert.
-Z
--~--~-~--~~~---~--~~
You received this message because you are
I'm just going through the same thing myself. For my particular
application, I'm not doing a shopping cart, just a lump sum
non-recurring payment. I was going to do all the HTTPS stuff myself to
the transaction handler for approval and I'll accept the "means of
payment" screens myself in Django.
Haven't used hat one , but I did just sign up with
http://www.zettai.net/ to host my Django app. The big driver for me was
a Virtual Private Server (VPS), so I can get root access and a
dedicated IP address. I'm not sure if razorlogix has that or not. The
rest looks comparable . I can vouch for th
SOLVED!
The text I was using for the value was unicode.
This resulted in the string not being quoted when the SQL was being
fabricated.
For now, I did a u"My Unicode String".encode('ascii') and it works
fine.
Cheers,
Zeb
--~--~-~--~~~---~--~~
You received this
Good point. Sadly, I'm not constructing the SQL, Django is. It could
very well be that postgres is mangling the value string (thinking it's
a column) ... that would possibly also explain why the exception
message is truncated. I was looking at the django code last night and
can't see anything obvi
It's definitely there and the database looks fine. I suspect the
problem is elsewhere ... the value being inserted into the database is
being mangled (as illustrated above), which makes me believe it's
confusing the value for the field name or something. Essentially ...
how did the value get conve
I did a django-admin "sqlclear" followed by an "install"... as I've
done every other time I modify my model. Is there something else I need
to do?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group
Hey guys,
(0.91 branch)
I recently added a new field to one of my model classes, now whenever I
attempt to save() a new record I get a ProgrammingError.
The call looks like this:
element = ScriptElement(script = script, scene = 0, type =
CHARACTER_ELEMENT, characterFirstName = firstName, chara
I agree Herb, you need transactions as the basis for making this work.
But, as you have stated you need other infrastructure to make the
optimistic locking work. Either of the two approaches you mentioned
make sense (although there are some issues in using timestamps). Again,
Hibernate is a good m
That sounds like a great suggestion Tim. That's the way I would expect
it to work as well.
--~--~-~--~~~---~--~~
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@goog
That's good to know, but as you have stated previously, transactions
alone won't solve this problem. There still needs to be some concept of
versioning on top of the transactions, which isn't trivial
(arguably/perhaps even harder to do right than supporting transaction
wrappers).
Perhaps we need
Hey guys ... that's fantastic ... just the sort of response I was
hoping to see from the start of this conversation. Like they say in AA
"the first step is admitting you have a problem" ;-)
I will definitely explore all those options and make my contributions
to the project.
All the best,
Zeb
Hmm, I don't think you could get a cycle short enough to avoid the race
conditions described above. I agree that keeping objects in memory will
not help the problem (as per my original post), but constantly
freshening the object won't work either.
Perhaps single-user is a an unqualified overstate
Thx for the feedback guys.
I agree that this problem is pretty fundamental. I don't know what
worries me more, the fact that the problem exists or the architects
don't see the problem.
I think in my case I can isolate the offending code and use some form
of "double-buffering" technique to solve
Hugo/Georg is exactly correct.
I'm sure there are many very large websites using Django, but from what
I see many are newspaper-style (many reads, few if any writes except by
the admins). I'd be curious how may sites are doing dynamic updates by
many concurrent users? In a read-only / content / p
Here is a blog article about what core functionality an ORM should
support:
http://pythonnotes.blogspot.com/2004/09/python-orm-tools.html
Specifically, take note of the paragraph that reads:
To implement true object persistence, each object needs a unique
identifier. Each ORM will use a differe
Sorry, but I don't think Django will work in anything but a single user
environment, or multi-users only doing read-only access. Unless someone
from the Django team can clarify. Please read my thread on this issue
... it's a big concern for me.
http://groups.google.com/group/django-users/browse_f
Does anyone from the Django team have any thoughts on this problem?
Am I missing something here?
-Z
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django
I'm sure I must be missing something obvious here folks, but perhaps
someone could shed some light for me.
Could someone please point me to some material on using Django in a
load-balanced environment?
The specific problem I'm facing is model ORM objects going "stale" (the
in-memory representati
Arghh ... updated to 0.91 and now it works.
Back to work everyone!
-Z
More on this ...
If I turn on show_indices ("... 'show_indexes': True"), then I can
navigate all the way down to my target media, until I actually click
one ... that's when I get the "redirection limit" error.
There are about 15 requests for the mangled URI shown above (each doing
a 302 redirect
Hey all,
I've been reading the other thread about static files and getting this
to work with the development environment (v 0.90).
Sadly, the instructions doesn't work for me, I keep getting 302 errors:
The following Html:
give me this error in the HTTP server:
[02/Feb/2006 02:26:10]
Actually, you know, I'm getting several situations where that
comparision is failing, but if I explicitely do foo.id = blah.id it
works. Looks like a bug. It seems to occur when I a foreign key lookup
like:
if foo.get_blah() == myBlah:
# doesn't always work ...
while
if foo.get_blah().id ==
Yup, Selenium is a nice package ... if you have to go to trouble of
browser-based unit testing I would strongly recommend it too.
Thx for the feedback!
-Z
Matthew,
Do you feel you can effectively test a web interface without dealing
with Javascript in the client? I may be missing something, but I don't
think twill supports javascript interpretation?
-Zeb
Thx Eric,
I'll look into this MixIn/No-table approach ... it seems interesting.
It looks like it should give me back the object-oriented features I
want of python and yet keep the business logic out of the view code. I
was wondering about using Manipulators as the controller, but I don't
know if
That's great ... thanks for the clarification.
-Z
Hi again,
I'm messing around with my Model and my views and putting a 'unittest'
jig around what I'm building. Certainly, I don't want to test at the
view layer (passing in HttpRequests and getting back HttpResponses), so
I find that I'm writing a "controller-like" layer between the view and
the
Hi there!
Just getting into django and so far I'm really impressed (although I
second the sentiment for creating a unit testing framework).
My question is this:
When I want to compare two model objects is it safe to do something
like this:
user = users.get_list(id__exact = 3)[0]
if user == my
95 matches
Mail list logo