Re: accessing instance in form

2007-05-04 Thread Malcolm Tredinnick

On Fri, 2007-05-04 at 15:00 -0700, Casey T. Deccio wrote:
> I'd like to be able to do some further validation in a form, based on
> the instance object from which the form was built (i.e., using
> form_from_instace).  This would be handy for either populating fields
> (i.e., for an extended form class) using the instance or for validation
> after the form has been submitted, based on previous information.  Is
> there a good way to do this?  Would it be appropriate to modify
> form_for_instance to include an 'instance' attribute in the returned
> class (or something similar)?

You could include the instance's primary key value in the form so that
you could retrieve it later. Although, remember that the person
submitting the form could change that value (even if it's a hidden
field), so you may wish to encrypt it in some fashion before including
it.

Part of your requirements -- validation based on existing information --
are something we want to implement as what we are calling "model-aware
validation", whereby models can do validation based on their current
contents and knowledge of "self". It isn't really implemented (or even
fully specified) yet, but it's something I want to look at before 1.0.

Regards,
Malcolm



--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: loaddata issue

2007-05-04 Thread Mark Jarecki
Hi Russ,

Here is the transcript of the output:

./manage.py sqlall Guide

BEGIN;

CREATE TABLE "Guide_venuetype" (

"id" serial NOT NULL PRIMARY KEY,

"venueTypeName" varchar(200) NOT NULL,

"venueTypeSlug" varchar(50) NOT NULL

);

CREATE TABLE "Guide_venue" (

"id" serial NOT NULL PRIMARY KEY,

"venueName" varchar(200) NOT NULL,

"venueSlug" varchar(50) NOT NULL UNIQUE

);

CREATE TABLE "Guide_venue_venueType" (

"id" serial NOT NULL PRIMARY KEY,

"venue_id" integer NOT NULL REFERENCES "Guide_venue" ("id")  
DEFERRABLE INITIALLY DEFERRED,

"venuetype_id" integer NOT NULL REFERENCES "Guide_venuetype" ("id")  
DEFERRABLE INITIALLY DEFERRED,

UNIQUE ("venue_id", "venuetype_id")

);

CREATE INDEX "Guide_venuetype_venueTypeName" ON  
"Guide_venuetype" ("venueTypeName");

CREATE INDEX "Guide_venuetype_venueTypeSlug" ON  
"Guide_venuetype" ("venueTypeSlug");

CREATE INDEX "Guide_venue_venueName" ON "Guide_venue" ("venueName");

CREATE UNIQUE INDEX "Guide_venue_venueSlug" ON  
"Guide_venue" ("venueSlug");

COMMIT;

and here is the minimal data file that fails:

cat test.json

[{"pk": "1", "model": "Guide.venuetype", "fields": {"venueTypeSlug":  
"stadium", "venueTypeName": "Stadium"}}]

Regards,

Mark


On 04/05/2007, at 10:10 PM, Russell Keith-Magee wrote:

>
> On 5/4/07, Mark Jarecki <[EMAIL PROTECTED]> wrote:
>>
>> Running the latest django vesion, just ran svn.
>>
>> Cut down models:
> ..
>
> I loaded some same venuetype data using the admin interface, dropped
> the db, recreated it, synced and loaded the data; it worked fine for
> me (Postgres 8.1 on OSX, psycopg1 backend)
>
> To try and track this further, can you provide:
> - A copy of a minimal data file that failes
> - A transcript of the output of ./manage.py sqlall guide (a listing of
> the sql executed to create the models in the first place)
>
> Yours,
> Russ Magee %-)
>
> >


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: migrating 400 images

2007-05-04 Thread Julio Nobrega

  Just "mv" or "rename" the files and UPDATE the database with the new
path. 10 seconds max.

On 5/4/07, Milan Andric <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm migrating a tutorials site to Django and have created a file model
> that is associated with tutorial pages, etc.  Now I need to go through
> and migrate all the old content.  Rather than upload 400 images I was
> hoping to write a script to call the File.save() method appropriately
> and just copy the images into the new location.
>
> Any thoughts on how to approach this?  Do you think this will likely
> take more time than just doing it by hand?
>
> Thanks,
>
> Milan
>
>
> >
>


-- 
Julio Nobrega - http://www.inerciasensorial.com.br

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Deos Django have Java Servlet's Listener like thing?

2007-05-04 Thread Mambaragi

I need to start a thread when Apache(+Python+Django) starts up, end
stop the thread when Apache stops.

If I use Java, I could do that with Java Servlet Listener, but I
couldn't have found how to do with django.

Is there anything like Servlet Listener in django,python?


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to change the size of input field from Django

2007-05-04 Thread Alessandro Ronchi

Alle venerdì 04 maggio 2007, Pythoni ha scritto:
> But I would need at least rows="20" cols="70".
> Is there a way how to change the size from Django directly and not by
> editing HTML code?
> Thank you
> L.B.

with newforms is very simple.
you create the form from the model, like
ContactForm = forms.models.form_for_model(Contact)

and then you can change the atttribute:
ContactForm.base_fields ["name"].widget.attrs ["size"] = "50"

or 

ContactForm.base_fields ["message"].widget.attrs ["rows"] = "10"
ContactForm.base_fields ["message"].widget.attrs ["cols"] = "50"

please tell me if it's the solution for your problem.
-- 
Alessandro Ronchi
Skype: aronchi - Wengo: aleronchi
http://www.alessandroronchi.net - Il mio sito personale
http://www.soasi.com - Sviluppo Software e Sistemi Open Source

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to change the size of input field from Django

2007-05-04 Thread Russell Keith-Magee

On 5/4/07, Pythoni <[EMAIL PROTECTED]> wrote:
>
> One of the field in my model is defined
> Description=meta.TextField()
>
> When I use
> {{form.Description}}
> in my input form( template)
> the field is not as large as I would need.
> When I check HTML I can see
>
>   name="Description" rows="10" cols="40">
>
> But I would need at least rows="20" cols="70".
> Is there a way how to change the size from Django directly and not by
> editing HTML code?

Using newforms, yes:

Pass in an 'attrs' argument to the Textarea widget. e.g.,

class MyForm(forms.Form):
text = fields.TextField(widget=widgets.Textarea(attrs={'cols':'70',
'rows':'20'}))

This defines a text field that will use a Textarea widget to render;
by default, Textarea uses 1 40x10 area, but this can be overridden.

if you want to get really fancy, you can define your own subclass of
Textarea that hard codes your preferred sizes, and then request that
the TextField you the new widget :

class MyTextarea(widgets.Textarea):
def __init__(self, attrs={}):
attrs.update({'cols':'70', 'rows':'20'})
super(MyTextarea, self).__init__(attrs)

class MyForm(forms.Form):
text = fields.TextField(widget=widgets.MyTextarea)

(Note - I haven't run this code so it might have a syntax error or
two, but it should be enough to give you an idea and get you on the
way).

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Communicate with whom you want to talk. It's Free!!

2007-05-04 Thread Jovi

A small programs can be placed on your webpage or blogs let surfers
easily contact you.
You just need to link to the following website set your Skype
account,
then paste the source code on your website. That's all.

http://gmodules.com/ig/creator?synd=open=http://yourjovi.googlepages.com/skype.xml

Sample page :

http://joviscool.blogspot.com/2007/05/communication-by-skype.html


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Using Admin to not delete records with other records associated with them.

2007-05-04 Thread Lismoreboy

> This does offend the DRY principle, but until Django has a prettier
> way of handling this, I will put up with the duplication.

Python gurus: Is it possible to write a python function
HasAssociatedRecordsAndIsRestricted() that would introspect the model
and database and restore DRY at this point?

e.g.

class Nlgroup(models.Model):
  description = models.CharField(maxlength=80)
  def delete(self):
if not HasAssociatedRecordsAndIsRestricted():
  super(Nlgroup, self).delete() # Call the "real" delete()
method

class People(models.Model):
  nl_group = models.ForeignKey(Nlgroup, cascade="restrict")


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Using Admin to not delete records with other records associated with them.

2007-05-04 Thread Lismoreboy

I am building a database system using Admin. Without patching Django I
have found a way to prevent deleting records with other records
associated with them.  This is the same problem addressed by ticket
#1007. http://code.djangoproject.com/ticket/1007

If we have a model:

class Nlgroup(models.Model):
  description = models.CharField(maxlength=80)

class People(models.Model):
  nl_group = models.ForeignKey(Nlgroup)

I want to prevent deletion of Nlgroup records if there are People
records that are associated with the group.

Here is how to do it. Override the delete function of Nlgroup

class Nlgroup(models.Model):
  description = models.CharField(maxlength=80)
  def delete(self):
if not People.objects.filter(nl_group__exact=self).count():
  super(Nlgroup, self).delete() # Call the "real" delete()
method

class People(models.Model):
  nl_group = models.ForeignKey(Nlgroup)

This does offend the DRY principle, but until Django has a prettier
way of handling this, I will put up with the duplication.


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



newforms, form_for_model, and FilePathField

2007-05-04 Thread James

Hi,

Quite new to both Django and python.

I'm trying to create a form using form_for_model with a model that has
a FilePathField as one of it's attributes. The documentation for
FilePathField states that the path parameter is the "absolute
filesystem path to a directory from which this FilePathField should
get its choices. "

My question is, given the implication of choices in the above, does
this mean that I should expect form_for_model to output that attribute
as a select tag? (It doesn't; it's just a plain text input.) Is that
how it worked with the old form framework? If yes, is that how it will
eventually work with newforms?

Thanks,

James


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



migrating 400 images

2007-05-04 Thread Milan Andric

Hi,

I'm migrating a tutorials site to Django and have created a file model
that is associated with tutorial pages, etc.  Now I need to go through
and migrate all the old content.  Rather than upload 400 images I was
hoping to write a script to call the File.save() method appropriately
and just copy the images into the new location.

Any thoughts on how to approach this?  Do you think this will likely
take more time than just doing it by hand?

Thanks,

Milan


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache + mod_python problem

2007-05-04 Thread oggie rob

> As i try to login into the admin, i alway get a message saying my
> browser does not accepr cookies!!
> But it isn't true!
>
> Any suggestion?

IE has a funny setting wrt media files & security settings - if you
use a separate server for media (e.g. media.company.com vs. www.company.com
as the django server), or even if you use http for media and force
https for content, then it may be treated differently. Security
through... okay, I don't see any security there, so I can't even say
security through obscurity.
Anyway, if so you can add "company.com" to the "trusted hosts" list or
run the media server from the same web address.

HTH,
 -rob


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache2/mod_python/Django problem

2007-05-04 Thread oggie rob

Check Unix permissions for the todo directory and/or settings.py file.
If apache can't access them, it won't run properly.

 -rob

On May 4, 6:49 am, RollyF <[EMAIL PROTECTED]> wrote:
> Could someone point me to a solution somewhere? I have a directory
> call apps and inside is a django project, todo (created using django-
> admin.py startproject todo). This application runs OK with Django's
> built-in server (manage.py runserver). I am trying to setup a staging
> server in Fedora 6, running Apache 2.x and Python 2.4.4. When I run
> the application I am getting the following error:
>
> EnvironmentError: Could not import settings 'todo.settings' (Is it on
> sys.path? Does it have syntax errors?): No module named
> apps.todo.settings
>
> Here's my setting in httpd.config
>
> 
>   SetHandler python-program
>   PythonHandler django.core.handlers.modpython
>   PythonPath "['/home/rxferoli/apps'] + sys.path"
>   SetEnv DJANGO_SETTINGS_MODULE todo.settings
>   PythonDebug On
>   PythonInterpreter todo
> 
>
> What am I missing in the config?
>
> TIA
> Rolly


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



accessing instance in form

2007-05-04 Thread Casey T. Deccio

I'd like to be able to do some further validation in a form, based on
the instance object from which the form was built (i.e., using
form_from_instace).  This would be handy for either populating fields
(i.e., for an extended form class) using the instance or for validation
after the form has been submitted, based on previous information.  Is
there a good way to do this?  Would it be appropriate to modify
form_for_instance to include an 'instance' attribute in the returned
class (or something similar)?

Regards,
Casey



--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



newforms inheritance

2007-05-04 Thread Casey T. Deccio
I'm trying to subclass django.newforms.forms.Form with class
ExtendedForm:

from django import newforms as forms
from django.db import models

class ExtendedForm(forms.Form):
base_fields = { 'new_field': forms.CharField() }

Then, given some class:

class MyModel(models.Model):
first_field = models.CharField(maxlength=16)
second_field = models.CharField(maxlength=16)

I call the following:

obj = MyModel.objects.get(id=1)
MyForm = form_for_instance(obj, form=ExtendedForm)
f = MyForm()

However, when I render f, only new_field shows up.  It appears that
DeclarativeFieldsMeta class is expecting the fields as class attributes,
when instead, the fields are in the attrs['base_fields'].  If I apply
the attached diff, then it seems to work.  Is this a valid fix, or am I
missing something?

Regards,
Casey

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---

Index: django/newforms/forms.py
===
--- django/newforms/forms.py	(revision 5148)
+++ django/newforms/forms.py	(working copy)
@@ -37,8 +37,11 @@
 'base_fields', taking into account parent class 'base_fields' as well.
 """
 def __new__(cls, name, bases, attrs):
-fields = [(field_name, attrs.pop(field_name)) for field_name, obj in attrs.items() if isinstance(obj, Field)]
-fields.sort(lambda x, y: cmp(x[1].creation_counter, y[1].creation_counter))
+if attrs.has_key('base_fields'):
+fields = attrs['base_fields'].items()
+fields.sort(lambda x, y: cmp(x[1].creation_counter, y[1].creation_counter))
+else:
+fields = []
 
 # If this class is subclassing another Form, add that Form's fields.
 # Note that we loop over the bases in *reverse*. This is necessary in


Re: Multiple processes for Django business logic

2007-05-04 Thread Jeremy Dunck

On 5/4/07, garyrob <[EMAIL PROTECTED]> wrote:
...
> So in a multiprocessor situation, our logic may be
> running simultaneously on multiple processors.
>
> The duration of the child processes is controlled by
> MaxRequestsPerChild.

That's correct.

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Adding comments to my story

2007-05-04 Thread gsmith

I am wanting to add the ability for registed users to be able to add
comments to a story.  I was reading that I need to 'update your
database with the comments model'.  I'm not sure what this means?  Do
I just need to import a specific module in my models.py file or do I
need to create a new class?  And if I need to create a new class what
fields do I need?  I have the following post class currently

class Post(models.Model):
title = models.CharField(maxlength=200)
slug = models.SlugField(prepopulate_from=('title',))
pub_date = models.DateTimeField('Date published')
body = models.TextField()
author = models.ForeignKey(User)
enable_comments = models.BooleanField(default=True)

def __str__(self,):
 return self.title

class Admin:
list_display = ('title','pub_date','enable_comments')
search_fields = ('title', 'slug', 'body')
list_filter = ('pub_date', 'enable_comments')


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Pagination causing mySQL error

2007-05-04 Thread Pashka R.

hm... you can check amount of the records before output... why not?


2007/5/4, Merric Mercer <[EMAIL PROTECTED]>:
>
> I have a template that has 3 non-contiguous areas.   I need to display
> the results of a query set across these three areas.
> My initial solution was to split up the query set in the template using
> "slice". For example:
>
> {% for object in object_list|slice:"1:6" %}area one {% endfor %}
> {% for object in object_list|slice:"6:9" %}area two {% endfor %}
> etc
>
> My problem is that this is not working with pagination correctly when
> the pagination returns less than the initial slice ( in this case 6).  I
> get the following errors (see below).
>
> Can anybody suggest how to avoid this? Many thanks
>
> MerMer
>
>
>
> Caught an exception while rendering.{% for object in
> object_listslice:"3:6" %}
> Exception Type: ProgrammingError
> Exception Value: (1064, "You have an error in your SQL syntax; check the
> manual that corresponds to your MySQL server version for the right
> syntax to use near '-1' at line 1")
> Exception Location: C:\Python24\Lib\site-packages\MySQLdb\connections.py
> in defaulterrorhandler, line 35
>
> >
>


-- 
//wbr Pashka R. <[EMAIL PROTECTED]>

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Creating a Blog: combining seperate parts

2007-05-04 Thread [EMAIL PROTECTED]

Evan:

> -
>
> A views.py:
> -
> def index(request):
> latest_values_list = Entry.objects.values()
>
> return render_to_response('blog/blog_list.html',
> {'latest_values_list': latest_values_list})
> -
>
> A template blog_list.html:
> -
> 
> Blog Homepage
>
> 
>
> {{title}}
>
> Published on {{pub_date}}
>
> {{body}}
>
> 
> -
>
> My views.py is very wrong. So for now ignore it.
>
> I want to have all the data from Entry visible through the template to a
> web browser. I don't know what is a fast and efficient way to have my
> views.py deal with the database and then have my template show it. If
> anyone has any ideas it would be great.
>
> Thanks, Evan

Why don't you try in views.py
def index(request):
 entries  = Entry.objects.all().order_by('-pub_date')

 t = loader.get_template('blog/index.html')
 c = Context({
 'posts' : entries,
 })

 return HttpResponse(t.render(c))

and in your html template something like this:

{% for post in posts %}
 
 {{ post.title }}
 
 {{ post.pub_date }}
 

 
 {{ post.body }}
 
{% endfor %}

RobertoZ


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Error In the production site

2007-05-04 Thread James Bennett

On 5/4/07, Grupo Django <[EMAIL PROTECTED]> wrote:
> Hello, I get very often an error from modpython, and I have no idea
> about what I should check, does anybody know it?

You're seeing this particular traceback because an internal error
occurred and you don't have a template for displaying the "internal
server error" message -- when DEBUG is True, Django does this on the
fly for you to display the traceback, but when DEBUG is False you must
create a template named '500.html' to display on an internal error
(called '500.html', because 500 is the HTTP status code for an
internal server error). If you look at the traceback you'll see a line
which says "You need to create a 500.html template", and the final
line is telling you Django could not find that template.

As for the error which started the whole sequence of events, if you've
configured the ADMINS setting and the settings for Django to send
email, then Django will email a traceback of the original error (the
one which happened before the non-existent '500.html' got in the way)
to everyone listed in ADMINS.

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: documentazione django

2007-05-04 Thread Haku

Ciao.
Che io sappia no, ma c'è un gruppo italiano :)

http://groups.google.com/group/django-it?lnk=li

Ciao!

On 4 Mag, 17:45, mardif <[EMAIL PROTECTED]> wrote:
> ciao a tutti,
>   volevo chiedere se qualcuno sa dirmi se esiste della documentazione
> di django in italiano, e se si, dove trovarla.
>
> grazie


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Example to develop an tipica Add/del/update web

2007-05-04 Thread [EMAIL PROTECTED]

Diego:

On May 4, 1:55 pm, Diego <[EMAIL PROTECTED]> wrote:
> Hi I need to develope a simple Add/del/update site with some reports.
> Is there any example?
>
> Thanks

I have posted a simple blogging application example in my blog:
http://www.zoia.org/blog/2007/04/23/using-dynamic-choices-with-django-newforms-and-custom-widgets/
You can skip the part about foreign-keys and many-to-many
relationships and go to the sample code at the end of the article.
It does not explain how to set up django or create an application (a
good reference for that is the Django Book:  
http://www.djangobook.com/en/beta/chapter02/)

RobertoZ


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Newforms and foreign keys

2007-05-04 Thread [EMAIL PROTECTED]

Bob:

> In this case the user has already navigated to some bar record and is
> trying to add a foo child record, so I know what the bar_id value is
> already and I'm not exposing bar_id to the user as an editable field.
> How do I get the current bar_id into foo record I'm creating with
> form.save()?
>
You should add the relationship before saving the form.  Maybe
something like this (had no time to try it, but I will try later):

if request.method == 'POST':
form = FooForm(request.POST)
if form.is_valid():
  form.clean_data['bar_id'] = bar_id
  form.save()
  (...)

RobertoZ



--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Newforms and foreign keys

2007-05-04 Thread Bob Dively

On May 4, 4:33 pm, Bob Dively <[EMAIL PROTECTED]> wrote:

> I'm struggling to understand newforms. Specifically, when creating a
> new record, I can't figure out how to populate the new record's parent
> foreign key value. For example (leaving out imports and so forth):

I've just become further confused by looking at the html source, which
has the bar_id value in a hidden form field. Why would this value not
be written to the database with newforms save() method? The user-
entered values in the visible form fields are written successfully,
but the resulting record has a NULL value in the bar_id column.

(Sorry, I should obviously have looked at the html source before
posting. Like, I said, I'm a definite Django n00b.)


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: date not saved in tutorial 2, a little more info

2007-05-04 Thread Mark Phillips

On May 4, 2007, at 10:39 AM, Mark Phillips wrote:

> I am walking through the tutorial again; new machine, new issues.
>
> In Tutorial 2, when I run the server, log in, and edit the Poll by
> changing the date using the Today link and click Save, django says
> the operation was completed but the old date still appears. History
> shows the edits but Action displays "no fields were changed."
>
> I am working on OS X 10.9, python 2.4, intel based Mac.
>
> I ran validate polls, and syncdb. No errors were reported.
>
> Where should I be looking?

I am using MySQL v4.1.22 for the database. The User editor in the  
admin site works as expected, so the database is fine.

I have included the models.py below; perhaps some kind soul will spot  
my error.

Is there a link to the completed tutorial code? Maybe I can spot my  
mistake by comparing my rendition with it.

  - Mark

File models.py

from django.db import models
import datetime

# Create your models here.
class Poll(models.Model):
 question = models.CharField(maxlength=200)
 pub_date = models.DateTimeField('date published')
 class Admin:
 fields = (
 (None, {'fields': ('pub_date', 'question')}),
 ('Date information', {'fields': ('pub_date',),  
'classes': 'collapse'}),
 )
 list_display = ('question', 'pub_date', 'was_published_today')

 def __str__(self):
 return self.question

 def was_published_today(self):
 return self.pub_date.date() == datetime.date.today()

class Choice(models.Model):
 poll = models.ForeignKey(Poll, edit_inline=models.TABULAR,  
num_in_admin=3)
 choice = models.CharField(maxlength=200, core=True)
 votes = models.IntegerField(core=True)

 def __str__(self):
 return self.choice

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



iTechArt Group - Custom Software Development and Offshore outsourcing Company

2007-05-04 Thread VB

iTechArt Group - Custom Software Development and Offshore outsourcing
Company

http://www.itechart.com/

Offshore custom software development company iTechArt - Web site and
Content Management Solutions development, CMS consulting: Ektron,
Drupal and DotNetNuke

iTechArt Group provides high quality custom software development
services and offshore software development. On December 2006, iTechArt
Group became an authorized Microsoft Certified Partner. This means
that our company has been recognized by Microsoft for our vast
expertise and authorized to custom software development; provide IT
service consulting and custom business solutions.

Custom Software Development and Offshore outsourcing Company iTechArt
has worked together since 2003 to design build and deliver .NET Web
Content Management software solutions that help clients meet their
strategic objectives. We are agile oriented development partner able
to consistently deliver solid results.

iTechArt software development team assemblies specialists in the
development of custom software applications and offshore software
outsourcing services.

Working concepts of our company are based on proven approaches and
international standards used for custom software development such as
Capability Maturity Model Integration for Software Engineering (CMMI-
SW). In the same breath we have our own standpoint on software
development process management which is fully effective and
comprehensible for our clients.


iTechArt offers software development in the next main directions:

1. Custom Software Development (Offshore outsourcing for worldwide
based software development companies.)

2. Software Development for Digital Signage (Media content development
and remote displays / information kiosks Web-based software
application management.)

3. Web Site Development  (E-commerce solutions, CMS/DotNetNuke/Ektron/
Drupal,  Web 2.0/PHP/MySQL/AJAX, Flash/Action script/Flex and many
more.)

4. Offshore Development Center (Dedicated development team of software
developers. Our offshore development centers operate as an extension
to clients' existing software engineering business.)

Contact iTechArt (  http://www.itechart.com/  )about custom software
development, end-to-end software solutions, outsourcing software
development, custom DotNetNuke module development, DotNetNuke
consulting, dotnetnuke hosting, first class Java and .Net developers,
software application design, software testing, Quality Assurance,
functionality testing and defect analysis, performance and stress
testing, usability testing, Microsoft Media Services and Adobe Media
Flash Server solutions, digital signage solutions and custom
development, Ektron CMS400.NET developers, CMS, .NET Web Content
Management software solutions

Web:
http://www.itechart.com/
http://www.itechart.com/Pages/ProductsServices/HowWeWork.aspx
http://www.itechart.com/Pages/ProductsServices/BusinessModels.aspx
http://www.itechart.com/Pages/ProductsServices/CustomSoftwareDevelopment.aspx
http://www.itechart.com/Pages/ProductsServices/DotNetNukeModuleDevelopment.aspx


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Diagram

2007-05-04 Thread David Larlet

2007/5/3, FrankW <[EMAIL PROTECTED]>:
>
> I'm teaching my son Django and came up with a diagram
> for him - you know what they say - a picture is worth a
> thousand words.
>
> The diagram is at http://zdecisions.com/zdmedia/img/django.jpg
>
> Any comments or suggestions for making it better?

Have you seen the Jeff Croft's one?
http://www2.jeffcroft.com/photos/432038560/

Regards,
David

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: extending the User Model error

2007-05-04 Thread James Bennett

On 5/4/07, *San* <[EMAIL PROTECTED]> wrote:
> but, when I tried to view it, I got an error:
>  Cannot resolve keyword 'user' into field

The field on your profile model **must** be named "user".

So, for example, this will work:

class MyProfile(models.Model):
mailing_address = models.TextField()
user = models.ForeignKey(User, unique=True)

But this will not, because the relation back to the User model is not
a field named "user":

class MyProfile(models.Model):
mailing_address = models.TextField()
django_user_account = models.ForeignKey(User, unique=True)



-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Example to develop an tipica Add/del/update web

2007-05-04 Thread Diego

Hi I need to develope a simple Add/del/update site with some reports.
Is there any example?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



extending the User Model error

2007-05-04 Thread *San*

I was trying to extend the user model as described here:
http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model

but, when I tried to view it, I got an error:
 Cannot resolve keyword 'user' into field

Here's my view.py
def profile(request, username):
uname = User.objects.get(username=username)
profile = uname.get_profile()

gender = profile.gender
age = profile.age

return render_to_response('home.html',
{'detail' : uname,
 'gender' : gender,
 'age' : age})

Anyone know whats wrong with it?


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



request.session.session_key is None

2007-05-04 Thread omat * gezgin.com

Hi,

I had my sessions working properly until now, but now I am getting
None as the value of request.session.session_key in my view function.
I don't know what change I made caused this.

I have double checked that:
- MIDDLEWARE_CLASSES has
'django.contrib.sessions.middleware.SessionMiddleware'
- INSTALLED_APPS has 'django.contrib.sessions'
- database is in sync

Do you have any idea about what may be causing this?


oMat


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache2/mod_python/Django problem

2007-05-04 Thread Paul Rauch

RollyF schrieb:
> Could someone point me to a solution somewhere? I have a directory
> call apps and inside is a django project, todo (created using django-
> admin.py startproject todo). This application runs OK with Django's
> built-in server (manage.py runserver). I am trying to setup a staging
> server in Fedora 6, running Apache 2.x and Python 2.4.4. When I run
> the application I am getting the following error:
> 
> EnvironmentError: Could not import settings 'todo.settings' (Is it on
> sys.path? Does it have syntax errors?): No module named
> apps.todo.settings
> 
> Here's my setting in httpd.config
> 
> 
>   SetHandler python-program
>   PythonHandler django.core.handlers.modpython
>   PythonPath "['/home/rxferoli/apps'] + sys.path"
>   SetEnv DJANGO_SETTINGS_MODULE todo.settings
>   PythonDebug On
>   PythonInterpreter todo
> 
> 
> 
> What am I missing in the config?
> 
> TIA
> Rolly
> 
> 

is in the dir "/home/rxferoli/apps" the dir todo?
inside the dir todo should be the file settings.py

mfg Paul Rauch

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache + mod_python problem

2007-05-04 Thread RollyF

Haku,

I fixed mine by giving executable permission to my "/home/username".
Like you I was frustrated by this error and tried all combinations in
httpd.conf, until I read Malcolm Tredinnick's  reply to similar
problem here:
http://groups.google.com/group/django-users/browse_thread/thread/921e8e8f5a68ec7a/f237a68a111bef24?lnk=gst=Could+not+import+settings=1#f237a68a111bef24

I run chmod 777 in my "home/username" and "home/username/apps"
directories and that fixed the problem. Hope this helps.

Rolly

On May 4, 4:13 am, Haku <[EMAIL PROTECTED]> wrote:
> Ok, i'm here with another question :D
>
> Everithing is fine on my development server (windows), but now i want
> to put my project on my production server
>
> My production Server is a VPS running everithing django needs to run,
> so i've modified my httpd.conf file adding the following lines:
>
> 
> SetHandler python-program
> PythonPath "['/root/mysite'] + sys.path"
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> PythonDebug On
> 
>
> but as i restart apache and surf tohttp://urltoproducion/mysite/I
> always get this ugly page with this ugly error:
>
> EnvironmentError: Could not import settings 'mysite.settings' (Is it
> on sys.path? Does it have syntax errors?): No module named
> mysite.settings
>
> where am i wrong? I guess it's a path problem or something like
> that...
>
> Thank you!!!
>
> Haku


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



High Resolution Wallpapers - New Series [ 48 / 276 ]

2007-05-04 Thread Kooooool forwords
[image: travel deals, tourist spots, cruises, cheap deals, luxury, vacation
tours, getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
*1939 Ford Sedan*
1600 X 1200
194 KB *1965 Shelby Cobra Daytona Coupe (Replica)*
1600 X 1200
134 KB *2005 Special Construction FXR _Reptilian DNA_*
1600 X 1200
450 KB *2006 Yamaha Roadliner*
1600 X 1200
203 KB  [image: travel deals, tourist spots, cruises, cheap deals, luxury,
vacation tours, getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
*Abyssinian Black and White Colobus Monkey, Lake Nakuru National Park, Kenya
*
1600 X 1200
330 KB *Achnahaird Beach, Scotland, Great Britain*
1600 X 1200
393 KB *ACS Image of NGC 5866*
1600 X 1200
234 KB *Adare Manor, County Limerick, Ireland*
1600 X 1200
579 KB  [image: travel deals, tourist spots, cruises, cheap deals, luxury,
vacation tours, getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
*Adult Black-Backed Jackal, Masai Mara, Kenya*
1600 X 1200
358 KB *Aerial of a House in Stiltsville, Biscayne National Park, Florida*
1600 X 1200
199 KB *Aerial View of Horseshoe Falls, Niagara Falls*
1600 X 1200
404 KB *Aerial View of Moorea Island, French Polynesia*
1600 X 1200
385 KB  [image: travel deals, tourist spots, cruises, cheap deals, luxury,
vacation tours, getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
*Aerial View of Mount Shasta, California*
1600 X 1200
423 KB *Aerial View of Reef Formations, South Pacific*
1600 X 1200
297 KB *Affectionate Cheetahs*
1600 X 1200
344 KB *African Sunset, Leopard*
1600 X 1200
115 KB[image: travel deals, tourist spots, cruises, cheap deals, luxury,
vacation tours, getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, luxury, vacation tours,
getaway deals , computer
desktop]
[image:
travel deals, tourist spots, cruises, cheap deals, 

Apache2/mod_python/Django problem

2007-05-04 Thread RollyF

Could someone point me to a solution somewhere? I have a directory
call apps and inside is a django project, todo (created using django-
admin.py startproject todo). This application runs OK with Django's
built-in server (manage.py runserver). I am trying to setup a staging
server in Fedora 6, running Apache 2.x and Python 2.4.4. When I run
the application I am getting the following error:

EnvironmentError: Could not import settings 'todo.settings' (Is it on
sys.path? Does it have syntax errors?): No module named
apps.todo.settings

Here's my setting in httpd.config


  SetHandler python-program
  PythonHandler django.core.handlers.modpython
  PythonPath "['/home/rxferoli/apps'] + sys.path"
  SetEnv DJANGO_SETTINGS_MODULE todo.settings
  PythonDebug On
  PythonInterpreter todo



What am I missing in the config?

TIA
Rolly


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



a comment on comments system and voting

2007-05-04 Thread omat * gezgin.com

Hi,

I feel like commenting and voting should be two separate applications,
because in a sites scope, there can be content other than comments,
say photos, that also need to be voted.

Wouldn't it be more natural and manageable to have a generic voting
application that keeps scores of every content and users?


oMat


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Multiple processes for Django business logic

2007-05-04 Thread garyrob

On Apr 19, 3:20 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> However, the Apache process lives beyond the expiration of a
> connection which uses KeepAlive, if that's the question.  Generally,
> an Apache process under prefork will server MaxRequestsPerChild
> requests before stopping.
>

Many thanks for your response. It's a big help.

Let me see if I understand a piece correctly:

Under Apache MPM prefork, there are multiple Apache child instances.
Each one contains a Python interpreter instance running Django and our
application logic. So in a multiprocessor situation, our logic may be
running simultaneously on multiple processors.

The duration of the child processes is controlled by
MaxRequestsPerChild.

If I'm missing something in the above, I'd appreciate being told so!

Thanks again,
Gary


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Is it possible to redirect with POST data?

2007-05-04 Thread Bob T.

Thanks, guys. That gives me a good start on handling the problem!



--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



date not saved in tutorial 2

2007-05-04 Thread Mark Phillips

I am walking through the tutorial again; new machine, new issues.

In Tutorial 2, when I run the server, log in, and edit the Poll by  
changing the date using the Today link and click Save, django says  
the operation was completed but the old date still appears. History  
shows the edits but Action displays "no fields were changed."

I am working on OS X 10.9, python 2.4, intel based Mac.

I ran validate polls, and syncdb. No errors were reported.

Where should I be looking?

  - Mark

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Pagination causing mySQL error

2007-05-04 Thread Merric Mercer

I have a template that has 3 non-contiguous areas.   I need to display 
the results of a query set across these three areas.
My initial solution was to split up the query set in the template using 
"slice". For example:

{% for object in object_list|slice:"1:6" %}area one {% endfor %}
{% for object in object_list|slice:"6:9" %}area two {% endfor %}
etc

My problem is that this is not working with pagination correctly when 
the pagination returns less than the initial slice ( in this case 6).  I 
get the following errors (see below).

Can anybody suggest how to avoid this? Many thanks

MerMer



Caught an exception while rendering.{% for object in 
object_listslice:"3:6" %}
Exception Type: ProgrammingError
Exception Value: (1064, "You have an error in your SQL syntax; check the 
manual that corresponds to your MySQL server version for the right 
syntax to use near '-1' at line 1")
Exception Location: C:\Python24\Lib\site-packages\MySQLdb\connections.py 
in defaulterrorhandler, line 35

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Bug with __str__(self) if we use "return %s %s" ???

2007-05-04 Thread Mike Axiak

Hi,

I copied the code exactly as you have it and tested, and -- as I
expected -- it worked fine. Are you sure you set the first_name and
last_name fields correctly?
Perhaps you're looking at the wrong object?

Cheers,
Michael Axiak

On May 4, 7:19 am, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote:
> Any idea ?
>
> Nicolas Steinmetz wrote:
>
> > Hello,
>
> > I have the following model :
>
> > class Trombi(models.Model):
> > first_name = models.CharField("Pr?nom", maxlength=40)
> > last_name = models.CharField("Nom", maxlength=40)
> > photo = models.ImageField("Photo", height_field="80",
> > width_field="80", upload_to="photos")
> > url = models.SlugField(prepopulate_from=("first_name",
> > "last_name"))
>
> > class Admin:
> > list_display = ['first_name', 'last_name']
> > list_filter = ['last_name']
> > search_fields = ['last_name']
>
> > class Meta:
> > verbose_name = "Photo"
> > verbose_name_plural = "Photos"
>
> > def __str__(self):
> > return "%s %s" % (self.first_name, self.last_name)
>
> > def get_absolute_url(self):
> > return "/people/%s" % (self.url,)
>
> > In Django admin (0.96), when I save data, I have :
>
> > L'objet Photo "first_name last_name" a ?t? modifi? avec succ?s
>
> > Instead of :
>
> > L'objet Photo "John Doe" a ?t? modifi? avec succ?s, if I set John as
> > first_name and Doe as last_name.
>
> > What's wrong ? Is it a conflict with User object ?
>
> > Regards,
> > Nicolas


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Bug with __str__(self) if we use "return %s %s" ???

2007-05-04 Thread Russell Keith-Magee
On 5/4/07, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote:
>
> > In Django admin (0.96), when I save data, I have :
> >
> > L'objet Photo "first_name last_name" a �t� modifi� avec succ�s
> >
> > Instead of :
> >
> > L'objet Photo "John Doe" a �t� modifi� avec succ�s, if I set John as
> > first_name and Doe as last_name.
> >
> > What's wrong ? Is it a conflict with User object ?

As a general guide when asking questions - If people don't understand
the question, they're not likely to offer an answer. My French
vocabulary is pretty much limited to ordering wine in restaurants, so
I have no idea what your error messages mean, let alone what could be
causing the problem.

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache + mod_python problem

2007-05-04 Thread Haku

Ok, i've solved the problem, wich was in the PythonPath (no "/mysite"
was needed :D )
But now i'm into another truble:
As i try to login into the admin, i alway get a message saying my
browser does not accepr cookies!!
But it isn't true!

Any suggestion?

On 4 Mag, 13:13, Haku <[EMAIL PROTECTED]> wrote:
> Ok, i'm here with another question :D
>
> Everithing is fine on my development server (windows), but now i want
> to put my project on my production server
>
> My production Server is a VPS running everithing django needs to run,
> so i've modified my httpd.conf file adding the following lines:
>
> 
> SetHandler python-program
> PythonPath "['/root/mysite'] + sys.path"
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> PythonDebug On
> 
>
> but as i restart apache and surf tohttp://urltoproducion/mysite/I
> always get this ugly page with this ugly error:
>
> EnvironmentError: Could not import settings 'mysite.settings' (Is it
> on sys.path? Does it have syntax errors?): No module named
> mysite.settings
>
> where am i wrong? I guess it's a path problem or something like
> that...
>
> Thank you!!!
>
> Haku


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to change the size of input field from Django

2007-05-04 Thread Bruno Tikami
You might also want to take a look at contrib/admin/views/template.py 's
class TemplateValidator

On 5/4/07, Bruno Tikami <[EMAIL PROTECTED]> wrote:
>
> Hi Pythoni!
>
> have you tried to take a look at  oldforms/__init__.py file? There, look
> for the LargeTextField class and it's render function. I understand it's not
> exactily what you wanted, but it's a point to start ;)
>
>
> good luck!
>
>
> Tkm
>
>
> On 5/4/07, Pythoni <[EMAIL PROTECTED]> wrote:
> >
> >
> > One of the field in my model is defined
> > Description=meta.TextField()
> >
> > When I use
> > {{form.Description}}
> > in my input form( template)
> > the field is not as large as I would need.
> > When I check HTML I can see
> >
> >  > name="Description" rows="10" cols="40">
> >
> > But I would need at least rows="20" cols="70".
> > Is there a way how to change the size from Django directly and not by
> > editing HTML code?
> > Thank you
> > L.B.
> >
> >
> > > >
> >
>

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



documentazione django

2007-05-04 Thread mardif

ciao a tutti,
  volevo chiedere se qualcuno sa dirmi se esiste della documentazione
di django in italiano, e se si, dove trovarla.

grazie


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: [django] Subject in posts

2007-05-04 Thread Brett Parker

On Fri, May 04, 2007 at 12:44:54AM -0500, James Bennett wrote:
> 
> On 5/4/07, Andr?s Mart?n <[EMAIL PROTECTED]> wrote:
> > This mail, is for proposing that in tha all e-mail's that send  to the
> > group, contain the [django] subject. First, because the client mail can
> > detect spam en it, and Second, for recognize each mail of mail-list. is a
> > form of have mail organize, and know as it is as.
> 
> This has been proposed multiple times in the past (please search the
> list archive at http://groups.google.com/group/django-users/), and it
> was decided not to add a prefix to the subject line; any good mail
> client, including GMail (which you seem to be using, judging by your
> email address) can filter on arbitrary headers in messages, so a much
> better solution that doesn't clutter up subject lines is to filter
> messages based on 'To: django-users@googlegroups.com'.

List-Id: 
^ That's a better header to match on, IMO, then if the list is
CC'd/BCC'd you'll still have the mail sorted in to the right folder
(it's how I sort all list traffic). Any mailing list without a List-Id
header probably isn't worth reading anyways!

Cheers,
-- 
Brett Parker

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache + mod_python problem

2007-05-04 Thread Bruno Tikami
Hi Haku!

I have the same problem last week. What I did was to reate a file called
.pth and saved it on /usr/lib/python2.4/site-packages/ inside this
file, I wrote the root path to my project..

try it & let me know the results.

good luck!

Tkm

On 5/4/07, Haku <[EMAIL PROTECTED]> wrote:
>
>
> Ok, i'm here with another question :D
>
> Everithing is fine on my development server (windows), but now i want
> to put my project on my production server
>
> My production Server is a VPS running everithing django needs to run,
> so i've modified my httpd.conf file adding the following lines:
>
> 
> SetHandler python-program
> PythonPath "['/root/mysite'] + sys.path"
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> PythonDebug On
> 
>
> but as i restart apache and surf to http://urltoproducion/mysite/ I
> always get this ugly page with this ugly error:
>
> EnvironmentError: Could not import settings 'mysite.settings' (Is it
> on sys.path? Does it have syntax errors?): No module named
> mysite.settings
>
> where am i wrong? I guess it's a path problem or something like
> that...
>
> Thank you!!!
>
> Haku
>
>
> >
>

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: [django] Subject in posts

2007-05-04 Thread Forest Bond
On Fri, May 04, 2007 at 10:53:03AM -0500, James Bennett wrote:
> Consider someone who doesn't have a 2400-pixel wide maximized email
> client, and who sees this set of subject lines:
> 
> [django-users] Problem with m
> [django-users] Needing help wi

I'd say it's time to change your mutt config :)

Unless you need to know the kb's in each and every message, that is.

-Forest


signature.asc
Description: Digital signature


Re: How to change the size of input field from Django

2007-05-04 Thread Bruno Tikami
Hi Pythoni!

have you tried to take a look at  oldforms/__init__.py file? There, look for
the LargeTextField class and it's render function. I understand it's not
exactily what you wanted, but it's a point to start ;)


good luck!


Tkm


On 5/4/07, Pythoni <[EMAIL PROTECTED]> wrote:
>
>
> One of the field in my model is defined
> Description=meta.TextField()
>
> When I use
> {{form.Description}}
> in my input form( template)
> the field is not as large as I would need.
> When I check HTML I can see
>
>  name="Description" rows="10" cols="40">
>
> But I would need at least rows="20" cols="70".
> Is there a way how to change the size from Django directly and not by
> editing HTML code?
> Thank you
> L.B.
>
>
> >
>

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



RE: Using newforms for multiple db rows

2007-05-04 Thread Chris Brand

> For the attendance form, you might use a MultipleChoiceField
> checkboxSelectMultiple widget, where the value of each choice is set
> to the pk of the student model.   You should get a list of id's that
> were checked when the form gets submitted.

Thank you very much. Sounds like that approach should work well.
I'll give it a go.

Chris



--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Accessibility

2007-05-04 Thread James Bennett

On 5/4/07, Martin Winkler <[EMAIL PROTECTED]> wrote:
> admin section: should be ok - except for M2M relationships - at least in
> auth.User edit-screen, because the group-area is dependent on
> JavaScript. As far as I know, everything has to work without javascript
> to conform to the specs, but I could be wrong, since I do not have a
> link to the specs at hand.

Is is not dependent on JavaScript -- remove the 'filter_interface'
argument form a ManyToManyField and you'll see it works fine without,
degrading to a normal HTML  element. The JavaScript
merely enhances that by adding niceities for those whose browsers
support them.

-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



ordering foreign key list

2007-05-04 Thread Daniel Provin
Hello

Is there any way to get a alphabetically ordered list for a foreignkey field
on the Admin Add page?
I imagine sorting it on the database call, but I really don't know how.

Daniel

-- 
--

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: [django] Subject in posts

2007-05-04 Thread Brett Parker

On Fri, May 04, 2007 at 01:46:22AM -0500, M Harris wrote:
> 
> On Friday 04 May 2007 00:44, James Bennett wrote:
> > This has been proposed multiple times in the past (please search the
> > list archive at http://groups.google.com/group/django-users/), and it
> > was decided not to add a prefix to the subject line; any good mail
> > client,
>   The reason it gets proposed multiple times is because it is a good 
> practice 
> and a very good idea... 
> 
>   Most mailing lists follow that convention... for instance see all of 
> the 
> openSUSE mailing lists... and zillions of others. The practice is not 
> difficult, doesn't really clutter the subject line all that much, and 
> benefits much of the community.

It's a waste of 14 characters if it's [django-users], and 7 as [django],
now, when you get people with broken mail clients that also keep
prepending Re: then those 14 characters become very important - my
terminal is usually only about 80 characters long, most of the time I
can only see around 20/25 characters of the subject line, I'd really
rather that they were all relevant than to lose them to an unneeded
prefix.

Thanks,
-- 
Brett Parker

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



delete obsolete content type entries...

2007-05-04 Thread Jens Diemer


I have delete some app models. So, in the internal django tables 
"django_content_type" and "auth_permission" are some old content types 
entries.

So i received errors like: "ContentType matching query does not exist." 
(When i create a new user group).

Is there a way to update the django tables automatically?

-- 
Mfg.

Jens Diemer



A django powered CMS: http://www.pylucid.org


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: [django] Subject in posts

2007-05-04 Thread James Bennett

On 5/4/07, Forest Bond <[EMAIL PROTECTED]> wrote:
> Every mailing list I've ever seen that uses prefixed subjects adds the prefix
> automatically.  Users shouldn't be bothered to add a repetitive prefix to 
> their
> emails.  We have machines to do that sort of stuff.

Adding prefixes to list mails is purely redundant, since any good
email client can already sort email into folders or automatically
apply labels based on headers, and it creates a usability problem.
Consider someone who doesn't have a 2400-pixel wide maximized email
client, and who sees this set of subject lines:

[django-users] Problem with m
[django-users] Needing help wi

And compare to:

Problem with mod_python
Needing help with sessions

Which one is more useful?

Again: the proposal has come up multiple times and has been shot down
multiple times. Is it really worth expending energy to argue with
something that's not important at all in the long run, and which won't
be changed at all by the arguing? ;)


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Denver Django and Python User groups

2007-05-04 Thread BC

Hello,

We are considering using Django for some projects at work. Is there
any sort of Django or Python users group in the Denver area?

Thanks,

Bryan


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Diagram

2007-05-04 Thread FrankW

Thanks for the comments, Tim.  The way that I use Forms is by
form_for_model, so I think its important to have Forms near Models.
Templates are very different - not python modules, not imported, so I
made them a different color.  I made Settings and URLs  orange, since
they are mostly declarative in nature.  What do you think about making
Models and Forms orange as well, since they are also mostly
declarative.

The arrow heads are worth discussing.  If you think of A --> B as A
imports B, they kind of make sense.  Templates are not python modules,
so they are not imported, but they are similarly processed via
render_to_response.  If we reverse the arrow heads, what word would
you use to describe the relationship?  The arrow from Models to
Database is different, I'll change that.

On May 3, 6:12 pm, Tim Chase <[EMAIL PROTECTED]> wrote:
> > I'm teaching my son Django and came up with a diagram
> > for him - you know what they say - a picture is worth a
> > thousand words.
>
> > The diagram is athttp://zdecisions.com/zdmedia/img/django.jpg
>
> > Any comments or suggestions for making it better?
>
> Handy.  I'm not sure how I'd change it exactly, but something to
> indicate a tighter relationship between Views/Forms/Templates and
> the Response might help.  Something perhaps like
>
> Response <- Views
>^
>   / \
>  /   \
>  Forms   Templates
>
> Inverting the arrow heads?  removing the arrow-heads?  grouping
> them together in some sub-box?  keeping Forms nearer
> Templates/Views rather than separated from the triangle by the
> Models?
>
> I laugh at how "tests" kinda floats out in the periphery, but it
> reflects where tests are in the picture, so it's only reflecting
> the truth. :)
>
> Otherwise, spiffy.
>
> -tim


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache + mod_python problem

2007-05-04 Thread Melech Ric

Try changing:

PythonPath "['/root/mysite'] + sys.path"


to

PythonPath "['/root'] + sys.path"

I think you only need to tell the server where to find 'mysite' since 
that is the root of your project. mod_python can then resolve 
'mysite.settings' because it found mysite in 'root'.

Hope this makes sense. Anyway, your problem sounds exactly like what I 
ran into the first time I moved my project over to mod_python / Apache.

Good luck,

MelechRic

Haku wrote:
> Ok, i'm here with another question :D
>
> Everithing is fine on my development server (windows), but now i want
> to put my project on my production server
>
> My production Server is a VPS running everithing django needs to run,
> so i've modified my httpd.conf file adding the following lines:
>
> 
>   SetHandler python-program
>   PythonPath "['/root/mysite'] + sys.path"
>   PythonHandler django.core.handlers.modpython
>   SetEnv DJANGO_SETTINGS_MODULE mysite.settings
>   PythonDebug On
> 
>
> but as i restart apache and surf to http://urltoproducion/mysite/ I
> always get this ugly page with this ugly error:
>
> EnvironmentError: Could not import settings 'mysite.settings' (Is it
> on sys.path? Does it have syntax errors?): No module named
> mysite.settings
>
> where am i wrong? I guess it's a path problem or something like
> that...
>
> Thank you!!!
>
> Haku
>
>
> >
>
>   


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Fwd: Excitment

2007-05-04 Thread anees rehman
-- Forwarded message --
From: anees rehman <[EMAIL PROTECTED]>
Date: May 3, 2007 10:16 PM
Subject: Excitment
To: Andrew Christiansen <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] ,
Jeff Schuman <[EMAIL PROTECTED]>, [EMAIL PROTECTED], DineISLAM
<[EMAIL PROTECTED]
>, django-users@googlegroups.com, [EMAIL PROTECTED],
[EMAIL PROTECTED]
, "[ Neotrix ]" <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED], [EMAIL PROTECTED], "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]>, [EMAIL PROTECTED],
[EMAIL PROTECTED], Karachi-786 group <[EMAIL PROTECTED]>,
[EMAIL PROTECTED], [EMAIL PROTECTED],
[EMAIL PROTECTED], Islamic Pak <[EMAIL PROTECTED]>,
[EMAIL PROTECTED], [EMAIL PROTECTED],
[EMAIL PROTECTED], [EMAIL PROTECTED],
[EMAIL PROTECTED], [EMAIL PROTECTED]

*Highly recommended***

Earn extra money daily

Adbux paids you daily
to visit websites
>
>   JOIN NOW 
> >
> >

A very new paid program started not long ago on 10th April 2007 so it is
> > > good to sign-up early where most people are not in it yet so that you can
> > > easily get a large pool of referrals. They have already gained more than
> > > 3 members within a short period. You can see how popular they are and
> > > how popular they will be. If you join now, you have a large pool of
> > > people that you can attract as your referrals. They will be able to earn
> > > well too if they have a large pool of referrals too.
> > >
> >JOIN NOW 
> > >
> >
This is a new progam that pays you to visit website. Very profitable when
you have a large pool of referrals.
You make money by simply visiting websites for at least 30 seconds/visit.
They will pay you $0.01 for each website you visit and $0.01 for each
website your referrals visit. The best part is you can have an unlimited
amount of referrals! Imagine if you have 100 referrals, you would have
easily earn $270 a month as they have at least 9 paid to view website daily
in their site so ** there is a definite constant earning daily for your
referrals and yourself. Once you have verify your email address, you
can *immediately login
to your account in their site to click on their surf ads to earn $0.09 by
visiting all the links. * If you *are concerned* whether they will pay you,
you can always go to their site to earn personally before spending time and
money referring *for about 7 weeks to earn $5 as their minimum payment is $5
*. Once they pay you and you have *gained confidence*, you can start
marketing for referrals to *earn a good income if you do get a large pool of
referrals *.

JOIN NOW 
Payments are issued via PayPal on a daily basis but you must request for a
payment to be processed. If you do not have a PayPal account, you can get it
free from *www.paypal.com* . (Small matter so don't
let it hinder you from a good potential earning opportunity)

Once requested, your payment will be issued within 24-48 hours (usually
sooner). You must earn at least $5 to receive payment.

No harm trying as it is free to join but takes a little time for the
verification email to send to you during the sign-up process. No download
necessary so no security fear. Remember to start earning immediately after
verification of email account. Login to your account in their site and click
on surf ads to view all the links to earn.   JOIN NOW


*
* 

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: loaddata issue

2007-05-04 Thread Russell Keith-Magee

On 5/4/07, Mark Jarecki <[EMAIL PROTECTED]> wrote:
>
> Running the latest django vesion, just ran svn.
>
> Cut down models:
..

I loaded some same venuetype data using the admin interface, dropped
the db, recreated it, synced and loaded the data; it worked fine for
me (Postgres 8.1 on OSX, psycopg1 backend)

To try and track this further, can you provide:
- A copy of a minimal data file that failes
- A transcript of the output of ./manage.py sqlall guide (a listing of
the sql executed to create the models in the first place)

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Case Sensitivity on MySQL searches

2007-05-04 Thread Tim Chase

>> It might even be as simple as tweaking the
>> db/backends/mysql/base.py and changing the entry in the
>> OPERATOR_MAPPING value from
>>
>>'exact': '= %s',
>>
>> to
>>
>>'exact': 'LIKE BINARY %s',
>
> This is exactly what "contains" does. Example:-
> 
> Entry.objects.get(headline__contains='LeNnon')
> will return "LeNnon but not lennon.
> 
> Using contains does the operating mapping for you.  It turns 'exact':
> = %s to 'exact:LIKE BINARY %s':

Close...contains also, according to

  django/models/fields/__init__.py (around line 172-173)

  (search for "lookup_type.*contains" in a regexp-aware editor)

tacks on percent-signs changing the query from

  fieldname LIKE BINARY 'criterion'

to

  fieldname LIKE BINARY '%criterion%'

which implements the semantic behavior of "contains".  The OP
asked for the former behavior but __contains will give the latter
behavior.  Thus,

 Entry.objects.get(headline__contains='LeNnon')

will return 'LeNnon' and 'Sir LeNnon-Goldstein' but not "lennon"
where it sounded like the OP wanted just 'LeNnon'.

-tim


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



subclassing form_for_model

2007-05-04 Thread Sean Mc Allister

Hi,
can somebody give me a hint how to subclass a form_for_model class? I
have read ticket 3815, but that doesn't seem to work too well for me. If
I simply subclass the Form, the new fields aren't added if I subclass
with argument form=newforms.Form only the new fields are there (see
below for details)
Any suggestions?

thanks, Sean

In [1]: from django import newforms as forms

In [2]: from polls import models

In [4]: PollForm = forms.form_for_model(models.Poll)

In [6]: class PollFormWithTest(PollForm):
   ...: test = forms.CharField()

In [7]: testForm=PollFormWithTest()

In [8]: testForm.fields
Out[8]: {'question': , 'pub_date': }

In [9]: testForm.test
Out[9]: 

# Now the recommended way (http://code.djangoproject.com/ticket/3815)
In [13]: PollForm2 =forms.form_for_model(models.Poll,form=forms.Form)

In [14]: class PollFormWithTest(PollForm2):
test = forms.CharField()
   :

In [16]: testForm=PollFormWithTest()

In [17]: testForm.fields
Out[17]: {'test': }




--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Making list of M2M field in object's __str__

2007-05-04 Thread Tim Chase

def __str__(self):
  return "%s (%s)" % (
self.title,
'/'.join(self.artists)
)
 This assumes that an Artist has a __str__ method as well.  If
 not, you could change that one line to
'/'.join([artist.name for artist in self.artists])
>>
>> Oh... [smacks forehead]
>>
>> instead of "self.artists" try "self.artists.all()"
>
> So, I did this, and Django complains that a string was expected for
> the join function, and it received an Artist instead.  I have a
> __str__ method defined for my Artist class.  Shouldn't it
> automatically be converting the Artist instance to a string?


Did you use the first or second variant?  The second should work.
 If you need, you can explicitly cast your Artist to a string with

  '/'.join([str(artist) for artist in self.artists.all()])

but

  '/'.join([artist.name for artist in self.artists.all()])

should also work.  I can't say I've understood the join()
method's insistence that its members be strings explicitly rather
than items that have a __str__ method.  If it wants a string from
an object, it should ask for the object as a string.  The same
annoying behavior manifests itself if you try

  ', '.join(["hello", 42, "world"])

because of the int, even though str(42) gives precisely the
behavior one would want in such a situation. I'm sure BDFL has a
reason for it, but it escapes me.

-tim




--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Bug with __str__(self) if we use "return %s %s" ???

2007-05-04 Thread Nicolas Steinmetz

Any idea ?

Nicolas Steinmetz wrote:

> 
> Hello,
> 
> I have the following model :
> 
> class Trombi(models.Model):
> first_name = models.CharField("Pr�nom", maxlength=40)
> last_name = models.CharField("Nom", maxlength=40)
> photo = models.ImageField("Photo", height_field="80",
> width_field="80", upload_to="photos")
> url = models.SlugField(prepopulate_from=("first_name",
> "last_name"))
> 
> class Admin:
> list_display = ['first_name', 'last_name']
> list_filter = ['last_name']
> search_fields = ['last_name']
> 
> class Meta:
> verbose_name = "Photo"
> verbose_name_plural = "Photos"
> 
> def __str__(self):
> return "%s %s" % (self.first_name, self.last_name)
> 
> def get_absolute_url(self):
> return "/people/%s" % (self.url,)
> 
> In Django admin (0.96), when I save data, I have :
> 
> L'objet Photo "first_name last_name" a �t� modifi� avec succ�s
> 
> Instead of :
> 
> L'objet Photo "John Doe" a �t� modifi� avec succ�s, if I set John as
> first_name and Doe as last_name.
> 
> What's wrong ? Is it a conflict with User object ?
> 
> Regards,
> Nicolas
> 
> 
> 


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: IndexError at /admin/auth/user/1/- String index out of range & TypeError at /admin/auth/user/1/ - 'int' object is unsubscriptable

2007-05-04 Thread Nicolas Steinmetz

Any idea ?

[EMAIL PROTECTED] wrote:

> 
> Hello,
> 
> For one of my models, I did the following thing :
> 
> """
> Civil state
> """
> 
> class Civilstate(models.Model):
> CIVILITY_CHOICES = (
>  ('single', 'C�libataire'),
>  ('taken', 'Mari�'),
> )
> who = models.ForeignKey(User, unique=True,
> verbose_name='Personne', edit_inline=models.STACKED, num_in_admin=1,
> max_num_in_admin=1)
> photo = models.ImageField('Photo', height_field=80,
> width_field=80, upload_to="photos", blank=True)
> street = models.CharField('Adresse 1', maxlength=100, core=True)
> street_bis = models.CharField('Adresse 2', maxlength=100,
> core=True, blank=True)
> zipcode = models.IntegerField('Code postal', maxlength=5,
> core=True)
> city = models.CharField('Ville', maxlength=100, core=True)
> phone = models.CharField('T�l�hone', maxlength=20, core=True)
> mobile = models.CharField('Portable', maxlength=20, core=True,
> blank=True)
> civility = models.CharField('Statut matrimonial', maxlength=20,
> choices=CIVILITY_CHOICES, core=True)
> birthdate = models.DateField('Date de naissance', core=True)
> children = models.IntegerField('Nombre d\'enfants', core=True,
> blank=True)
> 
> def __str__(self):
> return self.city
> 
> class Admin:
> list_display = ('who',)
> list_filter = ['who',]
> search_fields = ['who',]
> 
> class Meta:
> verbose_name = "Etat civil"
> verbose_name_plural = "Etats civils"
> 
> 
> When I edit the form in Django admin (running vanillia 0.96 version)
> in a standalone mode, it works well. When I edit and save from "User"
> form and if it's empty, it fails with the following traceback which I
> do not understand :
> 
> Traceback (most recent call last):
> File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py"
> in get_response
>   77. response = callback(request, *callback_args, **callback_kwargs)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/views/
> decorators.py" in _checklogin
>   55. return view_func(request, *args, **kwargs)
> File "/usr/lib/python2.5/site-packages/django/views/decorators/
> cache.py" in _wrapped_view_func
>   39. response = view_func(request, *args, **kwargs)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/views/
> main.py" in change_stage
>   329. new_object = manipulator.save(new_data)
> File "/usr/lib/python2.5/site-packages/django/db/models/
> manipulators.py" in save
>   165. if rel_new_data[related.opts.pk.name][0]:
> 
>   IndexError at /admin/auth/user/1/
>   string index out of range
> 
> If I fullfil the form in a standalone mode and then try to edit and
> save it from User form, I have the following traceback :
> 
> Traceback (most recent call last):
> File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py"
> in get_response
>   77. response = callback(request, *callback_args, **callback_kwargs)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/views/
> decorators.py" in _checklogin
>   55. return view_func(request, *args, **kwargs)
> File "/usr/lib/python2.5/site-packages/django/views/decorators/
> cache.py" in _wrapped_view_func
>   39. response = view_func(request, *args, **kwargs)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/views/
> main.py" in change_stage
>   329. new_object = manipulator.save(new_data)
> File "/usr/lib/python2.5/site-packages/django/db/models/
> manipulators.py" in save
>   172. if f.core and not isinstance(f, FileField) and
> f.get_manipulator_new_data(rel_new_data, rel=True) in (None, ''):
> File "/usr/lib/python2.5/site-packages/django/db/models/fields/
> __init__.py" in get_manipulator_new_data
>   289. return new_data.get(self.name, [self.get_default()])[0]
> 
>   TypeError at /admin/auth/user/1/
>   'int' object is unsubscriptable
> 
> If I remove the edit_inline propertie, User form works well.
> 
> Any idea ?
> 
> Regards,
> Nicolas
> 
> 
> 


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Vote to support dreamhost mod_python

2007-05-04 Thread Marc Fargas Esteve
One module I saw someday on my list of new packages on Debian:

from apt-cache show apache2-mpm-itk
Description: multiuser MPM for Apache 2.2
 The ITK Multi-Processing Module (MPM) works in about the same way as the
 classical "prefork" module (that is, without threads), except that it
allows
 you to constrain each individual vhost to a particular system user. This
 allows you to run several different web sites on a single server without
 worrying that they will be able to read each others' files.
 .
 Please note that this MPM is highly experimental, and is not from the same
 tree as the other MPMs.

The day it becomes "stable" it can be a nice thing, but for now the most
secure way is FastCGI ;)

About:
> Having two options is better than having only one. :)

Sure, but not if one of the two options means that your application is
readable by **any** user on that system (remember: you would need to give
'www-data' privileges to read you application data, which means that **ANY**
user could also read your app. data) which means that on a shared hosting
scenario **THis is not an option**

It can be on a private/dedicated server but **never** on a shared hosting,
on the most simple case the use of mod_python would allow any user on the
system to read your settings.py and you know what's on settings.py...
(database_password, etc ...).

On 5/4/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote:
>
>
> On May 4, 7:31 pm, "Marc Fargas Esteve" <[EMAIL PROTECTED]> wrote:
> > Has far as I know you cannot run mod_python applications as different
> users,
> > everything runs as the web server user except with some experimental
> module
> > around there, if this is the case, I would not go for mod_python.
>
> Which experimental module are you talking about? Do you mean the
> Apache PerChild MPM which was supplied in Apache 2.0 but was removed
> in Apache 2.2? My understanding is that PerChild wasn't viewed as
> being stable enough for mainstream use and why it was removed from
> Apache. Thus, not perhaps a good idea that it be used.
>
> Graham
>
>
> >
>

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Apache + mod_python problem

2007-05-04 Thread Haku

Ok, i'm here with another question :D

Everithing is fine on my development server (windows), but now i want
to put my project on my production server

My production Server is a VPS running everithing django needs to run,
so i've modified my httpd.conf file adding the following lines:


SetHandler python-program
PythonPath "['/root/mysite'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On


but as i restart apache and surf to http://urltoproducion/mysite/ I
always get this ugly page with this ugly error:

EnvironmentError: Could not import settings 'mysite.settings' (Is it
on sys.path? Does it have syntax errors?): No module named
mysite.settings

where am i wrong? I guess it's a path problem or something like
that...

Thank you!!!

Haku


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Noob question about javascript files

2007-05-04 Thread Haku

OK, this works great!

Thank you very much!!!

On 4 Mag, 04:34, theju <[EMAIL PROTECTED]> wrote:
> Since Javascript is a static file you have to define your js directory
> in your urls.py. I've used a lot of Javascript Libraries and all have
> worked successfully.
>
> First in urls.py
>
> (r'^js/(?P.*)$', 'django.views.static.serve', {'document_root':
> '/media/agora/js/lib/MochiKit/'}),
>
> And then in your templates
>
> 
>
> It's going to work.
>
> -Thejaswi Puthrayahttp://thejuhyd.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 from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Accessibility

2007-05-04 Thread Martin Winkler

Hi Allessandro, 

> Is Django framework ready to get Web Content Accessibility Guidelines
> - v 1.0 (WCAG 1.0) of WAI, and Section 508 paragraph 1194.22 of
> Rehabilitation Act?
> 
> I need to make a website that is conform to those specs, and I need
> to know If the admin section and newforms are already up to them.

admin section: should be ok - except for M2M relationships - at least in
auth.User edit-screen, because the group-area is dependent on
JavaScript. As far as I know, everything has to work without javascript
to conform to the specs, but I could be wrong, since I do not have a
link to the specs at hand.

The newforms and any other thing has nothing to do whether it's WAI
compliant or not. That is up to you!

Martin

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: [django] Subject in posts

2007-05-04 Thread Forest Bond
On Fri, May 04, 2007 at 12:37:33AM -0500, Andrés Martín wrote:
> This mail, is for proposing that in tha all e-mail's that send  to the group,
> contain the [django] subject. First, because the client mail can detect spam 
> en
> it, and Second, for recognize each mail of mail-list. is a form of have mail
> organize, and know as it is as.

Every mailing list I've ever seen that uses prefixed subjects adds the prefix
automatically.  Users shouldn't be bothered to add a repetitive prefix to their
emails.  We have machines to do that sort of stuff.

More over, you shouldn't expect others to accomodate what appears to be severe
deficiencies in your mail clients ability to deal with SPAM and sort incoming
messages (or your inability to properly configure those features).

One thing that I think would be nice, however, is if MIME digests were support
by Google groups.  I guess you can't get everything you want.

-Forest


signature.asc
Description: Digital signature


Django Accessibility

2007-05-04 Thread Alessandro Ronchi

Is Django framework ready to get Web Content Accessibility Guidelines - v 1.0 
(WCAG 1.0) of WAI, and Section 508 paragraph 1194.22 of  Rehabilitation Act?

I need to make a website that is conform to those specs, and I need to know If 
the admin section and newforms are already up to them.

If not, it's difficult to make by myself the needed changes?
-- 
Alessandro Ronchi
Skype: aronchi - Wengo: aleronchi
http://www.alessandroronchi.net - Il mio sito personale
http://www.soasi.com - Sviluppo Software e Sistemi Open Source

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Vote to support dreamhost mod_python

2007-05-04 Thread Georgi Stanojevski

Horst Gutmann напиша:

>> Has far as I know you cannot run mod_python applications as different

>> 
>> https://panel.dreamhost.com/?tree=home.sugg=Software%20Installations=mod_python

> 
> Exactly my reason why I won't vote for this. Dreamhost's FastCGI setup
> (and Python setup ;-) has some problems though, which took me ages to

Having two options is better than having only one. :)

-- 
Glisha
The perfect OS, MS-DOS!
No patches, no root exploits for 21 years.

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Vote to support dreamhost mod_python

2007-05-04 Thread Graham Dumpleton

On May 4, 7:31 pm, "Marc Fargas Esteve" <[EMAIL PROTECTED]> wrote:
> Has far as I know you cannot run mod_python applications as different users,
> everything runs as the web server user except with some experimental module
> around there, if this is the case, I would not go for mod_python.

Which experimental module are you talking about? Do you mean the
Apache PerChild MPM which was supplied in Apache 2.0 but was removed
in Apache 2.2? My understanding is that PerChild wasn't viewed as
being stable enough for mainstream use and why it was removed from
Apache. Thus, not perhaps a good idea that it be used.

Graham


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Vote to support dreamhost mod_python

2007-05-04 Thread Horst Gutmann

Marc Fargas Esteve wrote:
> Has far as I know you cannot run mod_python applications as different
> users, everything runs as the web server user except with some
> experimental module around there, if this is the case, I would not go
> for mod_python.
> 
> Anyway, as far as I know dreamhost supports FastCGI and Django works
> with that, why don't you use it? With FastCGI your application would be
> run with **your** username which is far better than running everything
> as the web server user ;)
> 
> On 5/4/07, *Alessandro Ronchi* <[EMAIL PROTECTED]
> > wrote:
> 
> 
> If you are a dreamhost customer, you can vote to ask the support of
> mod_python:
> 
> https://panel.dreamhost.com/?tree=home.sugg=Software%20Installations=mod_python
> 
> 
> 
> Please take 5 minutes to do that!

Exactly my reason why I won't vote for this. Dreamhost's FastCGI setup
(and Python setup ;-) has some problems though, which took me ages to
overcome since the posted solutions for these problems can work or don't
depending on what server you're on.

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Diagram

2007-05-04 Thread Frédéric Sidler
you miss the public request/response

2007/5/3, FrankW <[EMAIL PROTECTED]>:
>
>
> I'm teaching my son Django and came up with a diagram
> for him - you know what they say - a picture is worth a
> thousand words.
>
> The diagram is at http://zdecisions.com/zdmedia/img/django.jpg
>
> Any comments or suggestions for making it better?
>
>
> >
>

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Vote to support dreamhost mod_python

2007-05-04 Thread Marc Fargas Esteve
Has far as I know you cannot run mod_python applications as different users,
everything runs as the web server user except with some experimental module
around there, if this is the case, I would not go for mod_python.

Anyway, as far as I know dreamhost supports FastCGI and Django works with
that, why don't you use it? With FastCGI your application would be run with
**your** username which is far better than running everything as the web
server user ;)

On 5/4/07, Alessandro Ronchi <[EMAIL PROTECTED]> wrote:
>
>
> If you are a dreamhost customer, you can vote to ask the support of
> mod_python:
>
> https://panel.dreamhost.com/?tree=home.sugg=Software%20Installations=mod_python
>
> Please take 5 minutes to do that!
> --
> Alessandro Ronchi
> Skype: aronchi - Wengo: aleronchi
> http://www.alessandroronchi.net - Il mio sito personale
> http://www.soasi.com - Sviluppo Software e Sistemi Open Source
>
> >
>

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using anchor in views/templates

2007-05-04 Thread babis

ok i solved the problem with a litlte javascript

i added the following line to my body-tag


the only thing i have todo is passing the anchor var to my template

  
  anchor-var = 'first-anchor' #set dynamicly somewhere in the code

  param = {
   'anchor' : 'anchor-var',
   'configs' : confs,
  }

  l = loader.get_template(template)
  c = Context(param)

  return HttpResponse(l.render(c))

thank you again...

best regards


On May 4, 10:40 am, babis <[EMAIL PROTECTED]> wrote:
> Thank you so mutch
>
> best regards
>
> On May 4, 10:30 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
> > On Fri, 2007-05-04 at 01:22 -0700, babis wrote:
> > > so i have to use the HttpResponseRedirect() class, right?
>
> > Yes, that's correct.
>
> > > I am not very familiar with this class and its handling, can i pass it
> > > arguments like those i pass to an template?
>
> > All you pass to an HttpResponseRedirect() class is the URL to redirect
> > to. So your view would end with something like
>
> > return HttpResponseRedirect(http://www.foo.com/blah#anchor')
>
> > > how can i use my template with redirects. Would you please so kind
> > > and send some code snippets
>
> > Here's what happens when you use an HTTP redirect like this (with
> > anchors):
>
> > (1) Your view returns the redirect command, as above.
>
> > (2) The browser sees that response and sends a request to the server 
> > forhttp://www.foo.com/blah. Because the browser handles the anchor, the
> > server is not sent that information (there are many cases where this is
> > annoying, but that's the way life works, so it's no use complaining
> > about it).
>
> > (3) Your Django code sees a request for the /blah/ URL and some view is
> > called to construct that information. The view returns a fully rendered
> > template, just like normal. Notice that your view doesn't care about the
> > anchor, which is lucky because it never sees the anchor. So you don't
> > need to do anything special in your view.
>
> > (4) The server receives the full HTML page, renders it and scrolls the
> > page so that the requested anchor is in the viewport.
>
> > Hopefully that will give you enough to do some experiments and fit it
> > into your code.
>
> > Note, also, that if you don't want to use a redirect like this, you can
> > scroll to the right location using Javascript (setting the location.hash
> > value). You can find lots of code fragments for doing that on the web.
>
> > Regards,
> > Malcolm


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using anchor in views/templates

2007-05-04 Thread babis

Thank you so mutch

best regards


On May 4, 10:30 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2007-05-04 at 01:22 -0700, babis wrote:
> > so i have to use the HttpResponseRedirect() class, right?
>
> Yes, that's correct.
>
>
>
> > I am not very familiar with this class and its handling, can i pass it
> > arguments like those i pass to an template?
>
> All you pass to an HttpResponseRedirect() class is the URL to redirect
> to. So your view would end with something like
>
> return HttpResponseRedirect(http://www.foo.com/blah#anchor')
>
> > how can i use my template with redirects. Would you please so kind
> > and send some code snippets
>
> Here's what happens when you use an HTTP redirect like this (with
> anchors):
>
> (1) Your view returns the redirect command, as above.
>
> (2) The browser sees that response and sends a request to the server 
> forhttp://www.foo.com/blah. Because the browser handles the anchor, the
> server is not sent that information (there are many cases where this is
> annoying, but that's the way life works, so it's no use complaining
> about it).
>
> (3) Your Django code sees a request for the /blah/ URL and some view is
> called to construct that information. The view returns a fully rendered
> template, just like normal. Notice that your view doesn't care about the
> anchor, which is lucky because it never sees the anchor. So you don't
> need to do anything special in your view.
>
> (4) The server receives the full HTML page, renders it and scrolls the
> page so that the requested anchor is in the viewport.
>
> Hopefully that will give you enough to do some experiments and fit it
> into your code.
>
> Note, also, that if you don't want to use a redirect like this, you can
> scroll to the right location using Javascript (setting the location.hash
> value). You can find lots of code fragments for doing that on the web.
>
> Regards,
> Malcolm


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using anchor in views/templates

2007-05-04 Thread Malcolm Tredinnick

On Fri, 2007-05-04 at 01:22 -0700, babis wrote:
> so i have to use the HttpResponseRedirect() class, right?

Yes, that's correct.
> 
> I am not very familiar with this class and its handling, can i pass it
> arguments like those i pass to an template?

All you pass to an HttpResponseRedirect() class is the URL to redirect
to. So your view would end with something like

return HttpResponseRedirect(http://www.foo.com/blah#anchor')

> how can i use my template with redirects. Would you please so kind
> and send some code snippets

Here's what happens when you use an HTTP redirect like this (with
anchors):

(1) Your view returns the redirect command, as above.

(2) The browser sees that response and sends a request to the server for
http://www.foo.com/blah . Because the browser handles the anchor, the
server is not sent that information (there are many cases where this is
annoying, but that's the way life works, so it's no use complaining
about it).

(3) Your Django code sees a request for the /blah/ URL and some view is
called to construct that information. The view returns a fully rendered
template, just like normal. Notice that your view doesn't care about the
anchor, which is lucky because it never sees the anchor. So you don't
need to do anything special in your view.

(4) The server receives the full HTML page, renders it and scrolls the
page so that the requested anchor is in the viewport.

Hopefully that will give you enough to do some experiments and fit it
into your code.

Note, also, that if you don't want to use a redirect like this, you can
scroll to the right location using Javascript (setting the location.hash
value). You can find lots of code fragments for doing that on the web.

Regards,
Malcolm


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



I've added you as a friend on StumbleUpon

2007-05-04 Thread psabilla

psabilla ([EMAIL PROTECTED]) has invited you to
StumbleUpon!

You can see my other favorites here:
http://psabilla.stumbleupon.com

Thanks,
psabilla

---
StumbleUpon lets  you discover great sites with a
single click. Give it a try at:
http://www.stumbleupon.com/join.php?friend=1245832=c1l2tnyn4p3pt2q8


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using anchor in views/templates

2007-05-04 Thread babis

so i have to use the HttpResponseRedirect() class, right?

I am not very familiar with this class and its handling, can i pass it
arguments like those i pass to an template?
how can i use my template with redirects. Would you please so kind
and send some code snippets



On May 4, 9:45 am, babis <[EMAIL PROTECTED]> wrote:
> sorry, ignore the first message :)
>
> hey everyone,
>
> i have a question/problem..
>
> in my template i have defined some anchors like this
> 
> Header
>
> so, how can one jump to those anchor positions frow within a view.
>
> my view looks like this
>
> def theview(request):
>   template = 'thetemplate.html'
>
>   
>
>   param = {
> 'configs'   : confs,
>   }
>
>   l = loader.get_template(template)
>   c = Context(param)
>
>   return HttpResponse(l.render(c))
>
> now, how can i define the anchor position in this view to jump
> directly to the #first-anchor tag


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Vote to support dreamhost mod_python

2007-05-04 Thread Alessandro Ronchi

If you are a dreamhost customer, you can vote to ask the support of 
mod_python:
https://panel.dreamhost.com/?tree=home.sugg=Software%20Installations=mod_python

Please take 5 minutes to do that!
-- 
Alessandro Ronchi
Skype: aronchi - Wengo: aleronchi
http://www.alessandroronchi.net - Il mio sito personale
http://www.soasi.com - Sviluppo Software e Sistemi Open Source

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using anchor in views/templates

2007-05-04 Thread babis

sorry, ignore the first message :)


hey everyone,

i have a question/problem..

in my template i have defined some anchors like this

Header

so, how can one jump to those anchor positions frow within a view.

my view looks like this

def theview(request):
  template = 'thetemplate.html'

  

  param = {
'configs'   : confs,
  }

  l = loader.get_template(template)
  c = Context(param)

  return HttpResponse(l.render(c))

now, how can i define the anchor position in this view to jump
directly to the #first-anchor tag



--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using anchor in views/templates

2007-05-04 Thread Malcolm Tredinnick

On Fri, 2007-05-04 at 00:40 -0700, babis wrote:
> hey everyone,
> 
> i have a question/problem..
> 
> in my template i have defined some anchors like this
> 
> Header
> 
> so, how can one jump to those anchor positions frow within a view.
> 
> my view looks like this
> 
> def theview(request):
>   template = 'thetemplate.html'
> 
>   form = TheForm()

Generally, you would have to use an HTTP redirect. Anchors are not
processed on the server side. It is the browser that is responsible for
moving to the anchor position specified in the URL, so you need to ask
the browser to load the URL with the anchor in it.

Regards,
Malcolm


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: loaddata issue

2007-05-04 Thread Mark Jarecki

Running the latest django vesion, just ran svn.

Cut down models:

class VenueType(models.Model):
 venueTypeName = models.CharField(maxlength=200, db_index=True)
 venueTypeSlug = models.SlugField(prepopulate_from= 
('venueTypeName',), db_index=True)
 class Admin:
 pass

class Venue(models.Model):
 venueSlug = models.SlugField(prepopulate_from=('venueName',),  
unique=True, db_index=True)
 venueType = models.ManyToManyField(VenueType,  
filter_interface=models.HORIZONTAL)

Error:

Loading 'test' fixtures...
Installing json fixture 'test' from absolute path.
Installed 1 object(s) from 1 fixture(s)
Traceback (most recent call last):
   File "./manage.py", line 11, in 
 execute_manager(settings)
   File "/opt/python/lib/python2.5/site-packages/django/core/ 
management.py", line 1674, in execute_manager
 execute_from_command_line(action_mapping, argv)
   File "/opt/python/lib/python2.5/site-packages/django/core/ 
management.py", line 1588, in execute_from_command_line
 action_mapping[action](args[1:], int(options.verbosity))
   File "/opt/python/lib/python2.5/site-packages/django/core/ 
management.py", line 1418, in load_data
 cursor.execute(line)
   File "/opt/python/lib/python2.5/site-packages/django/db/backends/ 
util.py", line 12, in execute
 return self.cursor.execute(sql, params)
   File "/opt/python/lib/python2.5/site-packages/django/db/backends/ 
postgresql/base.py", line 44, in execute
 return self.cursor.execute(sql, [smart_basestring(p,  
self.charset) for p in params])
psycopg.ProgrammingError: ERROR:  relation "guide_venuetype_id_seq"  
does not exist

SELECT setval('Guide_venuetype_id_seq', (SELECT max("id") FROM  
"Guide_venuetype"));

Hope this helps.

Thanks again,

Mark



On 04/05/2007, at 4:46 PM, Russell Keith-Magee wrote:


On 5/4/07, Mark Jarecki <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've come across an issue trying to loaddata into my database, and am
> wondering if anyone else has come across this too? and how to go about
> fixing it.
>
> I have Apache2.2.4, mod_python3.3.1, Python-2.5.1, postgresql-8.2.4,
> psycopg2-2.0.5.1 installed.
>
> Please let me know if you require any more information.

Django version? :-)

> The following is the error I receive:
...
> psycopg.ProgrammingError: ERROR:  relation "guide_venuetype_id_seq"  
> does not
> exist
>
> SELECT setval('Guide_venuetype_id_seq', (SELECT max("id")
> FROM "Guide_venuetype"));

The problem here is that the sequence providing data for the
guide.venuetype table hasn't been created. The only reason I can think
that this wouldn't exist is if you are using a custom primary key on
your guide.venuetype table. Is this the case?

Failing that, can you provide the models.py for the app that causes
this problem (or preferably a cut down minimalist version that
exhibits the problem)?

Yours,
Russ Magee %-)




--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



using anchor in views/templates

2007-05-04 Thread babis

hey everyone,

i have a question/problem..

in my template i have defined some anchors like this

Header

so, how can one jump to those anchor positions frow within a view.

my view looks like this

def theview(request):
  template = 'thetemplate.html'

  form = TheForm()


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: IE6 is not accepting session cookies

2007-05-04 Thread omat * gezgin.com

Solved, finally. It was both the SESSION_COOKIE_DOMAIN and two IEs
running side by side.

For IE6 to accept session cookies, put the
SESSION_COOKIE_DOMAIN = "domain.com"
in your settings.py file.

And if you are running IE6 and IE7 together, watch out. IE6 standalone
version cannot accept cookies when running besides an installed
version of IE7. This can be with other combinations also, which I am
not going to test.



On 4 Mayıs, 09:51, "omat * gezgin.com" <[EMAIL PROTECTED]> wrote:
> No, the domain is "turkpop.com". I tried setting SESSION_COOKIE_DOMAIN
> to "turkpop.com", ".turkpop.com" and "www.turkpop.com". I also tried
> some combinations for the "localhost" and "127.0.0.1". Neither of them
> worked.
>
> I am running IE6 standalone version together with installed IE7 on the
> same machine for testing. I think there might be a buggy interference
> among them when running together. I will test with a machine with only
> IE6 installed.
>
> On 4 Mayıs, 02:47, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
>
> > On 5/3/07, omat * gezgin.com <[EMAIL PROTECTED]> wrote:
>
> > > I cannot set session cookies in IE6, thus I cannot handle sessions of
> > > my users that are using IE6.
>
> > I can't find the MSDN article now, but there is an issue with IE (not)
> > storing cookies for sites whose host/domain name includes a dash or
> > underscore (one, both I can remember which).
>
> > Does your site have a name like that?


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: IE6 is not accepting session cookies

2007-05-04 Thread omat * gezgin.com

No, the domain is "turkpop.com". I tried setting SESSION_COOKIE_DOMAIN
to "turkpop.com", ".turkpop.com" and "www.turkpop.com". I also tried
some combinations for the "localhost" and "127.0.0.1". Neither of them
worked.

I am running IE6 standalone version together with installed IE7 on the
same machine for testing. I think there might be a buggy interference
among them when running together. I will test with a machine with only
IE6 installed.



On 4 Mayıs, 02:47, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> On 5/3/07, omat * gezgin.com <[EMAIL PROTECTED]> wrote:
>
>
>
> > I cannot set session cookies in IE6, thus I cannot handle sessions of
> > my users that are using IE6.
>
> I can't find the MSDN article now, but there is an issue with IE (not)
> storing cookies for sites whose host/domain name includes a dash or
> underscore (one, both I can remember which).
>
> Does your site have a name like that?


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: loaddata issue

2007-05-04 Thread Russell Keith-Magee

On 5/4/07, Mark Jarecki <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've come across an issue trying to loaddata into my database, and am
> wondering if anyone else has come across this too? and how to go about
> fixing it.
>
> I have Apache2.2.4, mod_python3.3.1, Python-2.5.1, postgresql-8.2.4,
> psycopg2-2.0.5.1 installed.
>
> Please let me know if you require any more information.

Django version? :-)

> The following is the error I receive:
...
> psycopg.ProgrammingError: ERROR:  relation "guide_venuetype_id_seq" does not
> exist
>
> SELECT setval('Guide_venuetype_id_seq', (SELECT max("id")
> FROM "Guide_venuetype"));

The problem here is that the sequence providing data for the
guide.venuetype table hasn't been created. The only reason I can think
that this wouldn't exist is if you are using a custom primary key on
your guide.venuetype table. Is this the case?

Failing that, can you provide the models.py for the app that causes
this problem (or preferably a cut down minimalist version that
exhibits the problem)?

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: [django] Subject in posts

2007-05-04 Thread Kenneth Gonsalves


On 04-May-07, at 12:16 PM, M Harris wrote:

>> This has been proposed multiple times in the past (please search the
>> list archive at http://groups.google.com/group/django-users/), and it
>> was decided not to add a prefix to the subject line; any good mail
>> client,
>   The reason it gets proposed multiple times is because it is a good  
> practice
> and a very good idea...

the point is that the people who run the list get to choose - and  
they have chosen not to, so it is pointless discussing this (i was  
one of the first proposers, btw)

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: [django] Subject in posts

2007-05-04 Thread M Harris

On Friday 04 May 2007 00:44, James Bennett wrote:
> This has been proposed multiple times in the past (please search the
> list archive at http://groups.google.com/group/django-users/), and it
> was decided not to add a prefix to the subject line; any good mail
> client,
The reason it gets proposed multiple times is because it is a good 
practice 
and a very good idea... 

Most mailing lists follow that convention... for instance see all of 
the 
openSUSE mailing lists... and zillions of others. The practice is not 
difficult, doesn't really clutter the subject line all that much, and 
benefits much of the community.

I concur with the idea.~please...




-- 
Kind regards,

M Harris <><

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to change the size of input field from Django

2007-05-04 Thread Pythoni

One of the field in my model is defined
Description=meta.TextField()

When I use
{{form.Description}}
in my input form( template)
the field is not as large as I would need.
When I check HTML I can see

 

But I would need at least rows="20" cols="70".
Is there a way how to change the size from Django directly and not by
editing HTML code?
Thank you
L.B.


--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: User and UserProfile

2007-05-04 Thread Mi Reflejo
Nevermind.

Thank you Russ and BTW if someone is thinking "How can i make a generic
callback function for that purpose?"
http://www.djangosnippets.org/snippets/209/


Regards,
-- 
Martín Conte Mac Donell
http://www.catartico.com

On 5/3/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
>
>
> On 5/4/07, Mi Reflejo <[EMAIL PROTECTED]> wrote:
> > I just figured i can use a callback function in form_for_model.
> Something
> > like:
> >
> > def uform_callback(f, **kwargs):
> > "tell forms to ignore other fields differents for visible_field"
> > visible_fields = ['username', 'password', 'first_name', 'last_name']
> > if f.name not in visible_fields:
> > return None
> > return f.formfield(**kwargs)
> >
> > Is there another elegant way? :)
>
> Right now - no. However, I'm trying to get a discussion going on the
> dev list about this issue.
>
> Yours,
> Russ Magee %-)
>
> >
>

--~--~-~--~~~---~--~~
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---