Easiest fix is to run lighttpd on a different port and hand the request from
apache to lightpd with mod_proxy
Dont' need to worry about mod_python then, and it's faster.
On 01/08/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote:
>
>
> Read my comments at:
>
>
> http://groups.google.com/group/django
On 8/2/07, eXt <[EMAIL PROTECTED]> wrote:
>
> Hi
>
>As I said earlier i don't have (and don't remember) these settings.
> But you're right - it was in eclipse.ini. Now I use Eclipse Europa and
> Java 6 on Kubuntu (32 bit) and I don't have any errors (even null
> references mentioned by Nimrod)
On Aug 1, 11:22 pm, oggie rob <[EMAIL PROTECTED]> wrote:
> This is what middleware is made
> for.http://www.djangoproject.com/documentation/middleware/
>
> -rob
Sorry, I have recently been working with shopping carts and had
redirection on my brain. Fabien's suggestion is probably what you are
This is what middleware is made for.
http://www.djangoproject.com/documentation/middleware/
-rob
On Aug 1, 9:51 pm, Greg <[EMAIL PROTECTED]> wrote:
> I've created a shopping cart. I want to put something on the top of
> every page that let's people know how many items they have in their
> car
On 8/2/07, Greg <[EMAIL PROTECTED]> wrote:
>
> I've created a shopping cart. I want to put something on the top of
> every page that let's people know how many items they have in their
> cart. I have a lot of views that don't send any dictionary key's that
> contain shopping cart info. If I wa
You can create a custom tag, I've never done it myself, but it's in
the docs:
http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-tags
I am sure you can get more help if you need it, but this should get
you started.
On Aug 2, 12:51 am, Greg <[EMAIL PROTECTED]> wr
Yes. "filter" returns a set (hence the [] around "",
indicating a collection). If you are using a pk, where you can
guarantee a single returned value, use "get":
>>> p = Profile.objects.get(id=1)
>>> p.department
-rob
On Aug 1, 10:35 pm, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> i am tryin
You should be doing
>>> p = Profile.objects.get(id=1)#or .get(1) or one of the many other
>>> posibilities
filter returns a list of the results, in the case of id=# it probably
returns only one, but it's still a list of one member.
So in your case it would work if you did this:
>>>p= Profil
I suspect you get this error because "level" is a reserved keyword in
many databases.
Try renaming the field.
Johan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
hi,
i am trying to use the manage.py shell, for fast testing of what I
would like to do.
I have a model like this
class Function(models.Model):
"""Functions that KSK Employee account could use"""
name = models.CharField(maxlength=40)
url = models.CharField(maxlength=40, default='/'
I've created a shopping cart. I want to put something on the top of
every page that let's people know how many items they have in their
cart. I have a lot of views that don't send any dictionary key's that
contain shopping cart info. If I want to do this...do I now have to
edit every view retu
Kai:
I was worrying about how to use the django database api to do site
related queries. I mean how do I simply retrieve articles of a site
without having to use the custom query.
Harry
On Aug 1, 9:36 pm, "Kai Kuehne" <[EMAIL PROTECTED]> wrote:
> Hi Harry,
>
> On 8/2/07, gt7658b <[EMAIL PROTECT
So I was able to import everything it looks like ok, but when i go to
http://localhost/stockphoto/
it is giving me the following error:
TemplateSyntaxError at /stockphoto/
Template u'base.html' cannot be extended, because it doesn't exist
So I navigate to my installed stockphoto at c:/python25/L
On Aug 1, 9:25 pm, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> ... I just want to understand how
> django works for me to learn this framework well.
My guess as to the intent of the design is that caching a database
backed object in the session wouldn't be a good idea as it can get out
of sync
hi,
anyone to clarify this?
On Jul 17, 4:54 pm, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> If I use django.middleware.transaction.TransactionMiddleware, is
> @transaction.commit_on_success the default behavior? or I should
> always call on the python decorators?
>
> Thanks
> james
--~--~--
hi,
> request.user gets created by to OR mapping (from the sql database).
> request.session comes from a pickle (serialized to a bytestream).
>
> Both needs to be done for every request. You could use caching,
> but object caching (like for request.user) is not possible up to now.
>
Just like w
Nevermindgot it figured out. All I have to do is call
'checkout_form.htm' template again if my form is not valid. And then
within my 'checkoutform.htm' template add some if statements to make
sure they don't have any errors by using the following line.
{% if fo.b_firstname.errors %}What you
I've seen examples from other websites where when a form is submitted
and some of the required fields contain no data. It takes them back
to the same url and displays messages like '*** This field is
required' above the form field.
I currently have my form setup so that when it's submitted and s
Hi Harry,
On 8/2/07, gt7658b <[EMAIL PROTECTED]> wrote:
>
> Kai:
>
> Thanks for the suggestions. In this case, my Article will have
> relationship with category, not directly with site. Will I still be
> able to take advantage of the functions of site framework?
I don't understand you (well, it'
Kai:
Thanks for the suggestions. In this case, my Article will have
relationship with category, not directly with site. Will I still be
able to take advantage of the functions of site framework?
Harry
On Jul 31, 9:45 pm, "Kai Kuehne" <[EMAIL PROTECTED]> wrote:
> ManyToManyField maybe is way bet
On 8/1/07, sagi s <[EMAIL PROTECTED]> wrote:
> Not clear on what you mean by "more robust views". Can you please
> elaborate?
Write views which select more data.
> Regarding custom template tags, I guess I expect many users to want to
> use django this way, so I think that having a "load_view" t
Anybody?
On Aug 1, 2:49 pm, Greg <[EMAIL PROTECTED]> wrote:
> Ok..does anybody know what's wrong with this attempt at trying to get
> the 'limit-choices_to' to work?
>
> class Choice(models.Model):
> choice = models.ForeignKey(Collection, edit_inline=models.TABULAR,
> num_in_admin=5)
> si
Another option is to use AJAX to populate the "building block" areas.
e.g. (Using JQuery)
$(document).ready(function() {
$('#block1').load('/views/list_users');
$('#block2').load('/views/latest_articles');
});
...
...
-Eric Florenzano
On Aug 1, 11:34 am, sagi s <[EMAIL PROT
Nice. I think I will probably try to start with Jellyroll and just
customize it to my needs but I'm having an issue getting it installed
and functioning. I got everything setup I think but I am getting the
following error when trying to do a 'syncdb':
Error: Couldn't install apps, because there
Actually my question is two fold, most likely due to brain farts on my
end. I'm relatively a newbie to Django, so please bear with me.
Here's my scenario. I have this for my relationships:
Company->Dept->Sub-Dept->Employees->Roles
"->" represents a one-to-many relationship.
Problem #1:
If I do
Hi,
I wonder if it is possible to use i18n machinery with different
templates systems?
Let me describe what I mean: I've started playing with Django few days
ago, I just wanted to see what it offers. I know ZPT templates from
Zope, so I though I could use them instead of learning new template
sy
FIXED!! (mostly)
Changed my httpd.conf from:
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
PythonInterpreter my_django
PythonDebug On
PythonPath "['/home/shawn/myCode/intertubewaypoint
I was writing some unit tests for a model in which I'd written a custom
__cmp__ method and got a strange result. Is it a bug, feature, or just
something to warn people about.
django.db.models.Model defines __eq__ and __ne__ based on PK identity.
That means that all model objects are == to one an
Read my comments at:
http://groups.google.com/group/django-users/browse_frm/thread/24deb095a2b2e450/1c982558d464017a
The problem is caused by fact that manage.py effectively adds parent
directory and directory of site (by virtue of it being current working
directory). Thus it allows these thi
Combine values() and distinct(): AccessLog.objects.values('key').distinct()
http://www.djangoproject.com/documentation/db-api/#values-fields
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To p
Here is my urls.py:
from django.conf.urls.defaults import *
from intertubewaypoint.blog.models import Entry
blog_dict = {
'queryset': Entry.objects.all(),
'date_field': 'pub_date',
}
urlpatterns = patterns('',
(r'^intertubewaypoint/', include('intertubewaypoint.urls')),
how can I change the "related_name" value in a ForeignKey field dynamically
at model creation time?
--
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.
Recuerda: E
Hi
As I said earlier i don't have (and don't remember) these settings.
But you're right - it was in eclipse.ini. Now I use Eclipse Europa and
Java 6 on Kubuntu (32 bit) and I don't have any errors (even null
references mentioned by Nimrod).
On 31 Lip, 22:19, "Kevin Menard" <[EMAIL PROTECTED]>
The /home/shawn/myCode/intertubewaypoint does have my urls.py file in
it. They way I have my project currently setup is that
intertubewaypoint is my project directory, and I will have
applications under there (ex: intertubewaypoint/blog,
intertubewaypoint/photos, etc.). I want to have intertubew
how can I change the "related_name" value in a ForeignKey field dynamically
at model creation time?
--
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.
Recuerda: E
Not clear on what you mean by "more robust views". Can you please
elaborate?
Regarding the term "views", I do mean actually invoking the python
function via the url routing system. I would settle for calling a
regular python function that returns some html snippet but I think the
existing views w
Ok..does anybody know what's wrong with this attempt at trying to get
the 'limit-choices_to' to work?
class Choice(models.Model):
choice = models.ForeignKey(Collection, edit_inline=models.TABULAR,
num_in_admin=5)
size = models.ForeignKey(Size, core=True)
price = models.ForeignKey(Pric
I think I am confused about how to use generic relations properly -
when I delete something, cascading delete is not happening as
expected.
Here are my models:
class Permission(models.Model):
name = models.CharField(maxlength=32)
content_type = models.ForeignKey(ContentType, null=True)
On 8/1/07, sagi s <[EMAIL PROTECTED]> wrote:
> I realize that this is an option but it seems to me more natural to
> control the content from the template so a designer can build views
> using "lego-blocks", without having to tweak the view.
You either want:
1. More robust views, or
2. Some cust
Windows XP tips and tricks http://windowsxpsp2pro.blogspot.com
--~--~-~--~~~---~--~~
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 fr
Thanks for the quick reply!
I realize that this is an option but it seems to me more natural to
control the content from the template so a designer can build views
using "lego-blocks", without having to tweak the view.
Cheers,
Sagi
On Aug 1, 10:01 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wr
Hello,
> PythonPath "['/home/shawn/myCode/intertubewaypoint/'] + sys.path"
Your modules should live right below the PythonPath. If your urls.py
file is at /home/shawn/myCode/intertubewaypoint/urls.py, then that
line should probably read
PythonPath "['/home/shawn/myCode'] + sys.path"
In the view.py code that you have calling your
frontpage_template.html, you should put your code to query the
database and generate your user list and articles. You would then
pass these to your html template via:
return render_to_response('frontpage_template.html',
{'list_users':list_users,'l
I am trying to find a way to include a view in a template. The view
generates an html snippet based on a DB query + another template. In
pseudocode what I am trying to achieve is:
frontpage_template.html:
{{% include header.html %}}
{{% load /views/list_users %}}
{{% load /views/latest_articles %
Hi,
On 8/1/07, Thomas Guettler <[EMAIL PROTECTED]> wrote:
> if choices=(("a", "Letter A",) ...
>
> you set initial to "a". Simple, isn't it?
No, it isn't. It simply doesn't work with ModelMultipleChoiceField.
> Thomas
Kai
--~--~-~--~~~---~--~~
You received th
I must be missing something here because when I change the statement
to status = forms.ChoiceField(required=False, choices=statlist,
initial="choice3")
it still displays the 1st record in the list when I am trying to have the 3rd
choice be the selected
value.
Jeff
-- Original messa
added postgres unit tests to the schema-evolution branch. also fixed a
bug where constraint lookups in postgres broke after a model rename.
thanks,
derek
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django use
If you want something that lasts longer than a session (for how-ever
you configured it on your system), then you might consider writing
your own cookie, and checking for it at the relevant places. I don't
use this mechanism for authentication, but as a little additional
personalization touch to re
Ben, Vince,
Thanks for the input!
It confirms what I suspected after a brief scan through the admin doc
and the code.
Johan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this g
I have a log that I want to generate reports from. It is an access log
where each row represents a "hit." One of the columns in the table is
a key and each user has a unique key. Is there a way using Django's
database API to get the count of distinct keys so I can get the number
of unique users?
Hey James,
This might get you going in the right direction:
"The default SessionMiddleware that comes with Django lets you pick if
you want all sessions to be browser-length or persistent, if you want
to use different types of sessions based on a users preference (e.g.
the good old "Remember Me"
We'll I kinda got it to work. I added the following
(limit_choice_to):
sandp = models.ManyToManyField(Choice, limit_choices_to = {'choice':
2})
///
That works fine. However, I obviously want to take out the '2'. I
tried the following but it does not seem to work:
sandp = m
Hi all,
I need a bit of help. I figure that I am probably doing something
stupid, but here goes. I am trying to start a website and I have
Apache cofigured to use mod_python. I have a location node in my
httpd.conf set up as follows (the rest of the file is currently taking
the defaults for Ap
Hi Dave --
I'm not sure what's going on in your code example, but there's a
*much* easier way of copying an object::
>>> o = MyModel.objects.get(pk=1)
>>> o.id = None
>>> o.save()
By setting the ID (or whatever your primary key is called) to ``None``
and calling save() you'll force
I am using postgresql with postgresql_psycopg2.
On 1 Ağustos, 17:21, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 8/1/07, omat <[EMAIL PROTECTED]> wrote:
>
>
>
> > Shouldn't Django be reporting that failure? Success messages are
> > confusing.
>
> I _did_ get an error message, warning
On 8/1/07, omat <[EMAIL PROTECTED]> wrote:
>
> Shouldn't Django be reporting that failure? Success messages are
> confusing.
I _did_ get an error message, warning me about an invalid primary key:
psycopg.DatabaseError: {: 'ERROR: insert
or update on table "mytest_documentissue" violates foreign
Yes, the problem was I didn't have the second user on the db that I an
trying to initialize. As I only dump data for one application, and the
user data is in an other application, the foreign key constraint
fails. Thanks a lot...
Shouldn't Django be reporting that failure? Success messages are
co
Am Mittwoch, 1. August 2007 15:58 schrieb jeffhg58:
> In newforms when I use the choicefield, I haven't been able to figure
> out how to set the value to say the third value in the drop down list.
> I tried setting the initial=3 but that did not seem to work.
>
> Here is the definition of the choi
Browsing the lineup of speakers at OSCON, I noticed a familar
face in the top banner, front & center:
http://conferences.oreillynet.com/pub/w/58/presentations.html
How's it feel to be the poster-child for OSCON? ;)
-tkc
--~--~-~--~~~---~--~~
You received this
In newforms when I use the choicefield, I haven't been able to figure
out how to set the value to say the third value in the drop down list.
I tried setting the initial=3 but that did not seem to work.
Here is the definition of the choicefield
status = forms.ChoiceField(required=False, choices=s
On 8/1/07, omat <[EMAIL PROTECTED]> wrote:
>
> My bad. In my previous post, I think it would be a good idea to crop
> the models a bit for simplicity. Please use this one:
> http://dpaste.com/hold/15751/
Works fine for me, as long as you have two users defined (pk=1 and
pk=2). The fixture you pro
> There are professional-looking website templates for sale in several
> places (templatemonster, etc).
> Can those be used easily with Django ?
> Do they need to be designed specifically for Django ?
Django's templates are considerably more friendly towards such
uses than many templating langu
My bad. In my previous post, I think it would be a good idea to crop
the models a bit for simplicity. Please use this one:
http://dpaste.com/hold/15751/
On 1 Ağustos, 16:31, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 8/1/07, omat <[EMAIL PROTECTED]> wrote:
>
> > Thanks for the reply
Am Mittwoch, 1. August 2007 04:23 schrieb Alexandre Forget:
> Hi,
>
> I am stuck with this error, does someone know what it mean?
> I am using django svn and sqlite.
>
> This error happen when I try to delete an object with the admin
> interface but it delete fine with the shell.
>
Hi,
I submitt
On 8/1/07, omat <[EMAIL PROTECTED]> wrote:
>
> Thanks for the reply Russ...
>
> The models are here:
> http://dpaste.com/hold/15746/
>
> The dump in json format is here:
> http://dpaste.com/hold/15747/
>
Are you sure the fixture comes from these models? I get an immediate
failure because industry
I have custom save methods like:
class Issue(models.Model):
title = models.CharField(maxlength=150)
parent = models.ForeignKey('self',
null = True,
blank = True)
industries = models.ManyToManyField(Industry,
On 8/1/07, David Reynolds <[EMAIL PROTECTED]> wrote:
>
> How about .save() is being overridden and Super(Model, self).save()
> isn't being called?
FYI - as of [5658], fixtures call save() directly on the base Model
class, ignoring any user-defined save method.
Yours,
Russ Magee %-)
--~--~--
Hi,
try tu use a string for the view path.
--~--~-~--~~~---~--~~
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
Thanks for the reply Russ...
The models are here:
http://dpaste.com/hold/15746/
The dump in json format is here:
http://dpaste.com/hold/15747/
On 1 Ağustos, 15:52, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 8/1/07, omat <[EMAIL PROTECTED]> wrote:
>
>
>
> > Installed 34 object(s) f
I doesnt undestand where is the problem in this code :
The Application is :
Cit2
!--> Utente
I need to call the view Login in Utente so in the url i say :
from django.conf.urls.defaults import *
urlpatterns = patterns('',
# Example:
(r'^/?$', login),
# Uncomment this for adm
On 1 Aug 2007, at 1:52 pm, Russell Keith-Magee wrote:
On 8/1/07, omat <[EMAIL PROTECTED]> wrote:
Installed 34 object(s) from 1 fixture(s)
If this message is getting printed, then the fixture is getting loaded
_somewhere_, save() has been called on 34 object instances, and the
transaction h
On 8/1/07, omat <[EMAIL PROTECTED]> wrote:
>
> Installed 34 object(s) from 1 fixture(s)
If this message is getting printed, then the fixture is getting loaded
_somewhere_, save() has been called on 34 object instances, and the
transaction has been successfully committed.
The only way I can think
--~--~-~--~~~---~--~~
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 more optio
Well, problem was (of course) on my side. After struggling with this
problem for a day or two I just opened python on my laptop and typed
import syslog
and it worked, so there is standard python module syslog included
which of course does not have settings. So renaming the project to
syslogviewer
Hi,
It seems easy as 1-2-3 but, I couldn't manage to loaddata in my
fixture back into the db.
Despite the success message at the end, no data is inserted into the
db. I am running django revision 5783 with postgres.
I tried the following for json and xml. Both end with success messages
but with
Am Mittwoch, 1. August 2007 10:23 schrieb james_027:
> hi,
>
> I am seeking some enlightenment as why the user (variable use to track
> if the user is logged in or not) seems to be on the request level and
> not on the session which is the practice of most or all of web
> framework? If I am not wr
Russell Keith-Magee scribit:
> On 7/31/07, Nis Jørgensen <[EMAIL PROTECTED]> wrote:
>
>> I had the problem that any db error in any of my tests (including
>> setups) would cause all following tests to fail (because the transaction
>> was not rolled back). This was made even worse by the fact th
Thanks Kpoh
There's a misleading piecve of documentation in there about
EmailMultiAlternatives
I've reported a ticket to trac to fix it.
http://code.djangoproject.com/ticket/5042#preview
On Aug 1, 10:43 am, KpoH <[EMAIL PROTECTED]> wrote:
> check this outhttp://www.djangoproject.com/documentat
check this out
http://www.djangoproject.com/documentation/email/
Matt Davies пишет:
> Hello everyone
>
> I've been testing using the send_mail function, but I've heard that
> it's now deprecated, is that right?
>
> I've searched for some documentation on how to use the new
> Email_Message functio
Hello.
I have a view that should duplicate a model object and save it in the
database.
I tried with this code:
obj = MyModel.objects.get(pk=1)
obj2 = MyModel()
for e in obj.__dict__:
if e != 'id':
obj2.__setattr__(e, obj.__getattribute__(e)) #error
obj2.save()
But I get this error
Hello everyone
I've been testing using the send_mail function, but I've heard that it's now
deprecated, is that right?
I've searched for some documentation on how to use the new Email_Message
function but can't find any.
Can someone send me some links please?
humbly yours
--~--~-~--~--
I am having a bit of trouble installing stockphoto (
http://www.carcosa.net/jason/software/django/stockphoto/README.html )
I am wanting to try out just the functionality of the app itself, not
yet integrating it with a current project and am running into a few
errors. Here is my work flow as to
> // I prefer use names instead of ids in urls because it's more human
> friendly
Of course, this is just a functional example.
> I don't think that the use of the values method is that widespread...
> if you use I would suggest you to think it twice.
http://www.djangoproject.com/documentation/
hi,
I am seeking some enlightenment as why the user (variable use to track
if the user is logged in or not) seems to be on the request level and
not on the session which is the practice of most or all of web
framework? If I am not wrong request.user is done on the middleware
which will get execut
Patrick Anderson napisał(a):
> I'd like to create a couple of views that would allow users to retrieve
> their forgotten username or password by email.
>
> It seems to me that the only reliable way to do this would be for my
> application to require unique email addresses for User objects. How
> Is there anyway that I can have the 'sandp' Field only
> show choices that are tied to that collection?
Try using the limit_choices_to argument to ManyToManyField:
http://www.djangoproject.com/documentation/model-api/#many-to-many-relationships
Hope this helps,
Will.
--~--~-~--~---
Hi all,
I am a total Django newbie. Hence the probably silly questions:
There are professional-looking website templates for sale in several
places (templatemonster, etc).
Can those be used easily with Django ?
Do they need to be designed specifically for Django ? Do you know of
any vendor that
87 matches
Mail list logo