Re: Using django test suite with standalone script

2008-05-03 Thread Russell Keith-Magee

On Thu, May 1, 2008 at 9:02 PM, dcoy <[EMAIL PROTECTED]> wrote:
>
>  What I want to do is to use the django test suite, or more
>  specifically the test environment it can set up (with the test-db with
>  pre-populated data) to test the client-server part of the system.

Have you looked into the './manage.py testserver' command [1]? It
sounds like that might do what you need.

[1] 
http://www.djangoproject.com/documentation/django-admin/#testserver-fixture-fixture

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
-~--~~~~--~~--~--~---



child edit causes duplication with model inheritance

2008-05-03 Thread [EMAIL PROTECTED]

try:

class Base(models.Model):
name = CharField(max_length = 100)
class Admin:
pass

class A(Base):
desc = TextField()
class Admin:
   pass

if you add an "A" object then edit it and hit save it duplicates
itself. Does anyone else have this trouble with model inheritance?

thanks,

alan



--~--~-~--~~~---~--~~
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: Can I use Django to display data form a legacy database?

2008-05-03 Thread Karen Tracey
On Sat, May 3, 2008 at 11:55 PM, jmDesktop <[EMAIL PROTECTED]> wrote:

>
> If all I want to do is display a row(s) from a legacy database, one
> that I did not create with Django and syncdb, will Django do that?  Do
> I have to alter my legacy database in any way (assume it's a pre-
> existing MySQL, Oracle, or SQL Server database)?
>
> Thank you.
>

Search the docs on legacy and you'll find this:

http://www.djangoproject.com/documentation/legacy_databases/

Karen

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Can I use Django to display data form a legacy database?

2008-05-03 Thread jmDesktop

If all I want to do is display a row(s) from a legacy database, one
that I did not create with Django and syncdb, will Django do that?  Do
I have to alter my legacy database in any way (assume it's a pre-
existing MySQL, Oracle, or SQL Server database)?

Thank you.
--~--~-~--~~~---~--~~
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: Pass variable with HttpResponseRedirect

2008-05-03 Thread Michael
It would be very restful of you to pass that information through the url.
Beyond that you should look into sessions as described above or another
function (i don't know what that is), HttpResponseRedirect just redirects
the user's browser to another url.

Hope that helps,

Michael

On Sat, May 3, 2008 at 11:20 PM, Peter Rowell <[EMAIL PROTECTED]> wrote:

>
> > How can I pass a variable with HttpResponseRedirect? I've tried:
>
> I suggest using the session. This allows you to have arbitraily
> complex error structures.
>
>  E.g.,
>   session['errors'] = 
>   HttpResponseRedirect('to somewhere')
> then in your other view(s) do something like:
>  if 'errors' in session:
> something that handles errors.
>
> If you want to pass it to another web site altogether, it gets more
> complicated.
> >
>

--~--~-~--~~~---~--~~
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: Pass variable with HttpResponseRedirect

2008-05-03 Thread Peter Rowell

> How can I pass a variable with HttpResponseRedirect? I've tried:

I suggest using the session. This allows you to have arbitraily
complex error structures.

 E.g.,
   session['errors'] = 
   HttpResponseRedirect('to somewhere')
then in your other view(s) do something like:
  if 'errors' in session:
 something that handles errors.

If you want to pass it to another web site altogether, it gets more
complicated.
--~--~-~--~~~---~--~~
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: Production vs Development Environments

2008-05-03 Thread Justin Lilly
Hey Ben, You may consider virtualizing it. VMWare's offerings are getting
nicer and nicer and if you have a decent system around, Xen is also
something to check out.
 -justin

On Sat, May 3, 2008 at 2:45 PM, Ben Ford <[EMAIL PROTECTED]> wrote:

> We have several different mercurial repos backing instances of our
> project, and this works well. We can have different developers pushing their
> changes to different instances of th site for testing and then all of their
> changes can be consilidated into 'trunk' ready to be pushed to our live
> servers.In the case of simple bug fixes we can combine the step of pushing
> into trunk and pushing to live as well, so it's a pretty good setup!
>
> This is great for most cases, however when you get a subtle bug that has
> to do with your live environment, it falls somewhat short. It would be great
> if we could have a testing setup that mirrors our live setup (which consists
> of several servers, postgres failover and some other bits) however it would
> be too expensive!
> Ben
>
> On 03/05/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> >
> > A post from another thread got me wondering, how many people here have
> > their development environments closely mimic their production ones?
> >
> > Or is it common to have a development, staging and production
> > environments ?  That way your development environment could be
> > whatever is easiest for you to set up on your dev box, and your
> > staging could mimic production so you could work out any bugs there.
> >
> > In theory I would think the 3 environments would provide the most
> > robust system for developing, testing and rolling out code, but if
> > Django handles the different DB back-ends pretty well then you could
> > eliminate the staging environ and speed up your end-to-end process I
> > would think.
> >
> > Any thoughts or experiences you all would care to share?
> >
>
>
>
> --
> Regards,
> Ben Ford
> [EMAIL PROTECTED]
> +447792598685
>
> >
>


-- 
Justin Lilly
Web Developer/Designer
http://justinlilly.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
-~--~~~~--~~--~--~---



FreeSHOUTcast.com - Creating and offering the best SHOUTcast Servers

2008-05-03 Thread FreeSHOUTcast.com

Check!
http://www.FreeSHOUTcast.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: Admin : Select category -> show subcategory

2008-05-03 Thread Diego Ucha

Hello Martyn,

The main interaction, that i see you need is:
(On Product form) User select Category -> Subcategory field is auto-
filled -> User select a subcategory based on the category selected.

Then you will have to use some JS Library (I prefer JQuery, besides
there are some discussion about those libs on the list).

For filling this subcategory field, in terms of data transmission, i
use JSon, because JQuery has a fine JSon parser, in few lines it's all
done.

[]s,
Diego Ucha


On May 2, 6:05 am, martyn <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've created a simple product model :
>
> class Produit(models.Model):
> nom = models.CharField(maxlength=200)
> slug = models.SlugField(prepopulate_from=('nom',))
> description = models.TextField(blank=True)
> published = models.BooleanField(default=True)
> prix_ht = models.DecimalField(max_digits=30, decimal_places=2)
> famille = models.ForeignKey('Famille')
> sous_categorie = models.ForeignKey('SousCategorie')
> clic
>
> class Admin:
> pass
>
> I've got also Category and SubCategory :
>
> class Categorie(models.Model):
> nom = models.CharField(maxlength=200)
> slug = models.SlugField(prepopulate_from=('nom',))
> class Admin:
> pass
>
> def __str__(self):
> return self.nom
>
> class SousCategorie(models.Model):
> nom = models.CharField(maxlength=200)
> slug = models.SlugField(prepopulate_from=('nom',))
> categorie = models.ForeignKey('Categorie')
> class Admin:
> pass
>
> def __str__(self):
> return self.nom
>
> Is there a way in django admin, in the Product form, to select the
> category, then the subcategories of this category only are shown in
> the select list.
>
> Thanks a lot
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Pass variable with HttpResponseRedirect

2008-05-03 Thread Poz

Hello fellow Django users,

I've got what I hope to be a simple question. I've got a page with 4
forms on it. Each goes to a different URL then uses
HttpResponseRedirect to get back to the original page. I want to pass
back any errors to the main screen.

How can I pass a variable with HttpResponseRedirect? I've tried:

return HttpResponseRedirect('/event/'+str(e.id), {'errors': errors,})

Is this impossible or should I be going about it another way?

Thanks for being so great Django community,
Poz
--~--~-~--~~~---~--~~
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-admin] using multiple AdminSites

2008-05-03 Thread derek.hoy

I've just move a project onto newforms-admin, and the change has gone
fine.  Thanks to all who've worked on this.

The project has a public site and some customised admin for office
staff, so I'm thinking about having 2 AdminSites, one for office staff
and a basic one for sysadmin.

The /docs/admin.txt example gives this:

from myproject.admin import basic_site, advanced_site

urlpatterns = patterns('',
('^basic-admin/(.*)', basic_site.root),
('^advanced-admin/(.*)', advanced_site.root),
)

2 questions:

- how can you have different templates for each AdminSite
- if you register models to basic-admin, they won't show automatically
in advanced-admin and vice-versa

I'm missing something I think- or AdminSite isn't the way to do this.

Derek
--~--~-~--~~~---~--~~
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: absolute url overrides

2008-05-03 Thread Karen Tracey
On Sat, May 3, 2008 at 8:28 AM, Thierry <[EMAIL PROTECTED]>
wrote:

>
> ABSOLUTE_URL_OVERRIDES = {
>'django.contrib.auth.models.user': lambda o: "/members/%s/" %
> o.username,
> }
>
> Doesn't seem to be working, any idea why?
>

Doc (
http://www.djangoproject.com/documentation/settings/#absolute-url-overrides)
says this is a mapping of ''"app_label.model_name" strings'.  App_label, I
believe, is only the rightmost part of the Python path to the application
(in this case django.contrib.auth, so for rightmost part, just 'auth'). So
I'd try:

ABSOLUTE_URL_OVERRIDES = {
   'auth.user': lambda o: "/members/%s/" % o.username,
}

Karen

--~--~-~--~~~---~--~~
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: Default Pluralize logic

2008-05-03 Thread Karen Tracey
On Sat, May 3, 2008 at 5:39 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:

> Could someone please be kind to explain to me how the pluralize logic
> works in django?
> a.) pluralize template filter


Doc for this is here:
http://www.djangoproject.com/documentation/templates/#pluralize


> b.) Meta.verbose_name_plural
>

Doc for this is here:
http://www.djangoproject.com/documentation/model-api/#verbose-name-plural


> As default, I am expecting the pluralize to convert "country" to
> "countries". For exapmle, this doesn't happen in admin so I define the
> verbose_name_plural in the Meta inner class.
>

Per the doc, the default pluralize (filter) behavior is to simply add an s.
If that is not correct for the word in question, then you have to tell the
filter what the correct suffix is.  The doc also has an example of how to
specify that pluralize should change a -y to an -ies.

For the model's verbose plural name, again the doc states the default
behavior is to add an s.  If that isn't correct, then you need to specify
verbose_name_plural, as you have.


> Its straightforward to implement a function that can seemlessly handle
> this correctly as default, even if it was to read the pluralization
> rules from a rules. files or something equivalent.
>

Is it?  Maybe.  I don't know if anyone has proposed smartening-up Django's
pluralization rules in the past (I'm not even sure if you are proposing it
here?).  My gut feeling is it's probably something that has lots of
exceptions/special cases that would make it hard to get entirely right,
particularly for all languages, but maybe I'm unduly pessimistic.

Karen

--~--~-~--~~~---~--~~
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: get_FOO_display() and Update Messages

2008-05-03 Thread Karen Tracey
On Sat, May 3, 2008 at 2:15 AM, Greg Taylor <[EMAIL PROTECTED]> wrote:

>
> I was wondering if there's any reason why get_FOO_display() calls
> aren't being evaluated when updating/adding new objects via the admin
> interface. What I mean by this is:
>
> The workout "1" was changed successfully.
>
> Instead of:
>
> The workout "Running" was changed successfully.
>
> The field in question is an IntegerField with a choices tuple defined
> that looks like:
>
> WORKOUT_TYPE_CHOICES = (
>  (0, "Biking"),
>  (1, "Running"),
> )
>
> The class' __str__ method looks like this:
> return self.get_activity_type_display()
>
> Any ideas?
>

Sound like this problem:

http://code.djangoproject.com/ticket/6853

Karen

--~--~-~--~~~---~--~~
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: Installation problem...

2008-05-03 Thread Karen Tracey
On Sat, May 3, 2008 at 12:09 AM, Pedro Vidal <[EMAIL PROTECTED]> wrote:

> Hello guys, I'm a new django user, and I'm tryin since three days ago
> install django, but it's still not working...
> That's the problem:
>
> Installed Python, ok.
> Installed mod_python, ok.
> Downloaded and extracted django, renamed the folder to "django" and put it
> in C:/, everything ok.
> The Apache server is working.
> MySql working.
> I added the python path to PATH environment variable
> Opened "cmd", cd to django folder and executed "python setup.py install"
> Added in Apache's httpd.conf following line:
> LoadModule python_module modules/mod_python.so
>
> Following the information under the installation guide from django's
> official site, the troubles begin, and here I am completely lost:
> I add the following lines to the httpd.conf:
>
> 
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> PythonDebug On
> PythonPath "['c:/django'] + sys.path"
> 
>
> When I try to test this, acessing the http://localhost/mysite I can't see
> the page that should (I guess) be created.


'mysite' in the installation guide here is just a placeholder for your own
Django project code.  Django does not come with any pre-built site that you
can access immediately after installation.  You have to write at least a
little code yourself, and you haven't mentioned here that you have done
that?

I'd suggest running through the tutorial:

http://www.djangoproject.com/documentation/tutorial01/

to get an idea of the code you need to create in order to build your own
site.  You'll see there that it isn't even necessary (nor even recommended)
at this point to bother with setting up apache/mod_python.  Rather, simply
use the Django development server as you run through the tutorial and do
your own development.  Worry about setting up apache/mod_python when you get
to the point of wanting to put your Django project into real production use.

Karen


> So I ask all of you, where is the error? Or where ARE the errors???
> Sorry for my poor english, I'm brazilian and I have not found help
> articles in portuguese...
>
> I'm using these versions of archives:
> Django version 0.96.1
> python version 2.5
> mod-python version 3.3.1.win32-py2.5-Apache2.2.exe
> Apache version 2.2
> MySQL-python-1.2.2.win32-py2.5.exe
>
> Thanks for help,
> Pedro Vidal
>
> >
>

--~--~-~--~~~---~--~~
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: Production vs Development Environments

2008-05-03 Thread Ben Ford
We have several different mercurial repos backing instances of our project,
and this works well. We can have different developers pushing their changes
to different instances of th site for testing and then all of their changes
can be consilidated into 'trunk' ready to be pushed to our live servers.In
the case of simple bug fixes we can combine the step of pushing into trunk
and pushing to live as well, so it's a pretty good setup!

This is great for most cases, however when you get a subtle bug that has to
do with your live environment, it falls somewhat short. It would be great if
we could have a testing setup that mirrors our live setup (which consists of
several servers, postgres failover and some other bits) however it would be
too expensive!
Ben

On 03/05/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> A post from another thread got me wondering, how many people here have
> their development environments closely mimic their production ones?
>
> Or is it common to have a development, staging and production
> environments ?  That way your development environment could be
> whatever is easiest for you to set up on your dev box, and your
> staging could mimic production so you could work out any bugs there.
>
> In theory I would think the 3 environments would provide the most
> robust system for developing, testing and rolling out code, but if
> Django handles the different DB back-ends pretty well then you could
> eliminate the staging environ and speed up your end-to-end process I
> would think.
>
> Any thoughts or experiences you all would care to share?
> >
>


-- 
Regards,
Ben Ford
[EMAIL PROTECTED]
+447792598685

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Production vs Development Environments

2008-05-03 Thread titaniumlou

A post from another thread got me wondering, how many people here have
their development environments closely mimic their production ones?

Or is it common to have a development, staging and production
environments ?  That way your development environment could be
whatever is easiest for you to set up on your dev box, and your
staging could mimic production so you could work out any bugs there.

In theory I would think the 3 environments would provide the most
robust system for developing, testing and rolling out code, but if
Django handles the different DB back-ends pretty well then you could
eliminate the staging environ and speed up your end-to-end process I
would think.

Any thoughts or experiences you all would care to share?
--~--~-~--~~~---~--~~
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: Pass extra data to a view

2008-05-03 Thread Jay Parlar

On 5/3/08, Mike Chambers <[EMAIL PROTECTED]> wrote:
>
>  Could you just specify the data in the URL that you redirect to?
>
>  mike

In my case, it's a variable amount of data, a list of ids from the
database. I suppose I could specify it in the URL. I've got it working
with sessions now, but passing it in the URL seems more RESTful.

Jay

--~--~-~--~~~---~--~~
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 on mod_python... Admin interface, no styling...

2008-05-03 Thread Abdallah El Guindy

Thanks... that solved it!

On May 3, 6:22 pm, jonknee <[EMAIL PROTECTED]> wrote:
> > I tried deploying my django project on apache+modpython as the
> > tutorial described... Everything works fine except that the admin
> > website displays unformatted ... (could not manage to find the
> > stylesheet somehow), can anyone tell me what went wrong?
>
> See "Serving the admin files" in the mod_python Django installation
> instructions
>
> http://www.djangoproject.com/documentation/modpython/
--~--~-~--~~~---~--~~
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 can I pass extra context variables into my changelist_view?

2008-05-03 Thread Brot

Hello,

today I switched my django installation from the django-trunk to the
django newforms-admin branch.

With the oldform admin I had changed the changelist for one model
based on the explanation in the djangobook (http://www.djangobook.com/
en/1.0/chapter17/)
But with the newforms admin I couldn't detect how to pass extra
context variables into my changelist view?!
There is an explanation how I can pass extra context variables into my
change form, but this solution don't work in my case.

I would like to show some extra information above the changelist
(change_list.html) and for that reason I need to pass some extra
context into ModelAdmin.changelist_view.
Or is there another change to solve my problem?

 Bernd
--~--~-~--~~~---~--~~
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 on mod_python... Admin interface, no styling...

2008-05-03 Thread jonknee

> I tried deploying my django project on apache+modpython as the
> tutorial described... Everything works fine except that the admin
> website displays unformatted ... (could not manage to find the
> stylesheet somehow), can anyone tell me what went wrong?

See "Serving the admin files" in the mod_python Django installation
instructions

http://www.djangoproject.com/documentation/modpython/

--~--~-~--~~~---~--~~
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: Sorry to butt in. I'm just trying to get my message out.

2008-05-03 Thread Etienne Robillard

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Fri, 2 May 2008 11:49:19 -0700 (PDT)
Slayer <[EMAIL PROTECTED]> wrote:

> 
> Please come check out SaveTheWorld.  It's my own group that I'm trying
> to get started.
> There's no harm in looking is there?  Come see what I'm trying to do
> to change the world.
> Come to look, to laugh, to get enraged in debate, but please come.

Actually, you're right. 
Changing the world needs more than just open source projects.

But please don't spam this list with stupidities.

Thanks,
Etienne
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkgcgr4ACgkQ0H/Gee/mchQgkgCfRjLTwsI91hqiBWV5GzUDyydE
VBsAoJlOIGe5ydCuTNr/cFeKcZAfrV6Z
=agab
-END PGP SIGNATURE-

--~--~-~--~~~---~--~~
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: Translated DB

2008-05-03 Thread Dmitry Rubinstein
Wow, thanks! Now I have to decide which one to use... :)

On Sat, May 3, 2008 at 4:26 PM, Panos Laganakos <[EMAIL PROTECTED]>
wrote:

>
> Two projects exist:
>
> http://code.google.com/p/django-multilingual/
> http://code.google.com/p/transdb/
>
> DM uses an inner class on the model, to define the translatable
> fields.
>
> TransDB uses custom field types.
>
>
> Hopefully they'll be merged at some point or work on a new uniform way
> to do this.
>
> On May 3, 4:22 pm, dimrub <[EMAIL PROTECTED]> wrote:
> > Suppose, you want to have a model, the fields of which are available
> > in multiple languages. How would you people go around doing it? The
> > most trivial method would be to define as many variations of each text
> > field as there are lanugages, and define a function inside the model
> > that returns the variation that corresponds to currently chosen
> > language, and use this function in all the views instead of the actual
> > fields. Are there any other patterns in place? Just don't want to
> > invent a wheel here.
> >
>


-- 
Vale,
Dmitry Rubinstein

--~--~-~--~~~---~--~~
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: Translated DB

2008-05-03 Thread Panos Laganakos

Two projects exist:

http://code.google.com/p/django-multilingual/
http://code.google.com/p/transdb/

DM uses an inner class on the model, to define the translatable
fields.

TransDB uses custom field types.


Hopefully they'll be merged at some point or work on a new uniform way
to do this.

On May 3, 4:22 pm, dimrub <[EMAIL PROTECTED]> wrote:
> Suppose, you want to have a model, the fields of which are available
> in multiple languages. How would you people go around doing it? The
> most trivial method would be to define as many variations of each text
> field as there are lanugages, and define a function inside the model
> that returns the variation that corresponds to currently chosen
> language, and use this function in all the views instead of the actual
> fields. Are there any other patterns in place? Just don't want to
> invent a wheel here.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Translated DB

2008-05-03 Thread dimrub

Suppose, you want to have a model, the fields of which are available
in multiple languages. How would you people go around doing it? The
most trivial method would be to define as many variations of each text
field as there are lanugages, and define a function inside the model
that returns the variation that corresponds to currently chosen
language, and use this function in all the views instead of the actual
fields. Are there any other patterns in place? Just don't want to
invent a wheel here.
--~--~-~--~~~---~--~~
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: Template variable in filter?

2008-05-03 Thread pk

Isn't this already in settings.py?
Look at the code for the filters
/django/template/defaultfilters.py
it reads DATE_FORMAT and TIME_FORMAT from the settings file.

P.K.

On Apr 29, 2:25 am, Mike Chambers <[EMAIL PROTECTED]> wrote:
> Is it possible to include a template variable inside a filter?
>
> Specifically, I want to have a global setting for the date format string:
>
> Something like:
>
> settings.py
> --
> DATE_TIME_FORMAT = "M j, F \a\t P"
>
> template
> --
> {{ comment.date_submitted|date:{{DATE_TIME_FORMAT
>
> I am guessing that I could write a custom filter that handles this, was
> curious if there was another way to do it.
>
> mike
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Django on mod_python... Admin interface, no styling...

2008-05-03 Thread Abdallah El Guindy

Hey all

I tried deploying my django project on apache+modpython as the
tutorial described... Everything works fine except that the admin
website displays unformatted ... (could not manage to find the
stylesheet somehow), can anyone tell me what went wrong?

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
-~--~~~~--~~--~--~---



Re: Should I set up Django locally or on a web server?

2008-05-03 Thread pk

if you are running Leopard (IMPORTANT) it is very easy to setup
Django.
I wrote up what I did here:
http://www.pkshiu.com/loft/archive/2008/01/django-on-leopard

The key is to just use sqlite and the development server to do
development.

There are some issues with sqlite compare to postgresql (I use that
for production). sqlite is more forgiving in some situations so you
will
find some subtle errors later on, but it's not a big deal.

P.K.

--~--~-~--~~~---~--~~
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: Patch #2070, progress bar and form view. Can't make it work.

2008-05-03 Thread John Hensley

The handling of the POST request is typical. I don't know what your  
model class
looks like, but the  could look something like this:

   form = UploadForm(request.POST, request.FILES)
   if form.is_valid():
 instance = ModelClassWithFileField()
 instance.uploaded_by = request.user
 save_instance(form, instance)
 request.user.message_set.create(message=_('Your file has been  
received.'))

That's it. The progress magic really happens in the code from the  
snippets you listed: the upload handler that tracks progress in the  
cache, and the view that reports it. Your template's going to need  
some JavaScript, too, of course, to get the progress reports and  
update the page.

I think that's all it took for me. Make sure you've got the latest  
version of the 2070 patch ... and make sure you've got a caching  
mechanism configured; forgetting to start memcached on your dev box  
after a reboot can cause some head-scratching. ;^)

John

On May 2, 2008, at 11:40 PM, Julien wrote:

>
> Hi everyone,
>
> I'm trying to use patch with ticket #2070 [1] to be able to upload big
> files and have a progress bar, and I can't quite figure out how to
> make it work...
>
> I'm also using 2 snippets [2] and [3]. Then, here's my simple view and
> template:
>
> View
> ---
>
> def frontpage(request):
>if request.method == 'POST':
># [] I don't know what to put there!...
>else:
>form = UploadForm()
>
>return render_to_response('frontpage.html',
>  { 'form': form },
>
> context_instance=RequestContext(request))
>
> Template
> -
>
> [insert javascript from snippet [3] here]
>
>enctype="multipart/form-data"
>   method="post">
> {{ form }}
>   
> 
>
>
> Settings
> ---
> from django.conf import global_settings
> FILE_UPLOAD_HANDLERS =
> ('upload.upload_handler.UploadProgressCachedHandler', ) +
> global_settings.FILE_UPLOAD_HANDLERS
>
> The form just contains a file input. When I press submit,  I enter the
> view again but I don't know what code to put in that view to replace
> the [] thing above. Should that code wait for the end of the
> upload before returning anything, and if so, how?
>
> I couldn't find any help on the ticket page or on this mailing list.
> Can you see what I'm missing to make it work?
>
> Many thanks!
>
> Julien
>
>
> [1] http://code.djangoproject.com/ticket/2070
> [2] http://www.djangosnippets.org/snippets/678/
> [3] http://www.djangosnippets.org/snippets/679/
> >


--~--~-~--~~~---~--~~
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: Templating patterns

2008-05-03 Thread pk

sometimes extending the template system with application specific tags
solves my problem. YMMV of course.

On May 2, 1:49 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I've got a lot of templates with the same pattern, so i want to put
> some code like this in a template.
>
> {% if iterable %}
> {% for variable in iterable %}
> <{{tag}}> something  
> {% endfor %}
>
> Is it  posible to send the {{tag}} variable as a parameter from
> another template (where i use the include 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
-~--~~~~--~~--~--~---



absolute url overrides

2008-05-03 Thread Thierry

ABSOLUTE_URL_OVERRIDES = {
'django.contrib.auth.models.user': lambda o: "/members/%s/" %
o.username,
}

Doesn't seem to be working, any idea why?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



djangoAMF: django and flash

2008-05-03 Thread Lorenzo

Hi,
I need to link a flash movie with Django, so I userd djangoAMF.
I followed the tutorial 
(http://djangoamf.sourceforge.jp/index.php?UserManual_en) and seems to 
work fine, but when I  put the results inside a textbox in my flash 
application, it understand data as a float number!

In django I use a simple helloworld function:
-
def HelloWorld(req):
return "HelloWorld"
--
In flash I followed the  so the handleResult function is:
-
function handleResult(re:ResultEvent):Void {
this.message_txt.text = re.result;
}
-

The result is that in message_txt I find a strange number like 
"4.432432e-123" that seems somehow related to the string (if I change 
string the number change! otherwise it remain the same).

Someone has experience with this kind of problem?

Thanks,


Lorenzo

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



When and how is dispatcher.connect() called?

2008-05-03 Thread Jonathan Lukens

I have two functions in a signals.py module that I would like called
whenever instances of a number of models are saved or deleted.
Everything works as intended when I add all of this to each models.py
module:

from django.dispatch import dispatcher
from django.db.models import signals
from project.feed_summary.signals import create_feed_summary,
delete_feed_summary

class Foo(models.Model):
   ...

dispatcher.connect(create_feed_summary, sender=Foo,
signal=signals.post_save)
dispatcher.connect(delete_feed_summary, sender=Foo,
signal=signals.pre_delete)

However, I would really love have a tuple in settings.py something
like:

FEED_SUMMARY_SETTINGS = ('model_import_path',)

And just tack models onto that as necessary, with something like this
somewhere in the feed_summary app so that it is self-contained:

for m in FEED_SUMMARY_SETTINGS:
   dispatcher.connect(create_feed_summary, sender=m,
signal=signals.post_save)
   dispatcher.connect(delete_feed_summary, sender=m,
signal=signals.pre_delete)

Is this possible?  Advisable?  If so, where is the best place to drop
that code so the dispatchers don't just get garbage collected?

Thanks,
Jonathan
--~--~-~--~~~---~--~~
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: Pass extra data to a view

2008-05-03 Thread Lei Zhang
Hi
I used to do this by putting the data in URL parameters.
Does anyone knows a more elegant way to do this?


>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Default Pluralize logic

2008-05-03 Thread [EMAIL PROTECTED]

Could someone please be kind to explain to me how the pluralize logic
works in django?
a.) pluralize template filter
b.) Meta.verbose_name_plural

As default, I am expecting the pluralize to convert "country" to
"countries". For exapmle, this doesn't happen in admin so I define the
verbose_name_plural in the Meta inner class.

Its straightforward to implement a function that can seemlessly handle
this correctly as default, even if it was to read the pluralization
rules from a rules. files or something equivalent.

Regards,
-Alen

--~--~-~--~~~---~--~~
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: get_FOO_display() and Update Messages

2008-05-03 Thread dimrub

Yay another fitness app based on django!

http://code.google.com/p/fiteat/

On May 3, 9:15 am, Greg Taylor <[EMAIL PROTECTED]> wrote:
> I was wondering if there's any reason why get_FOO_display() calls
> aren't being evaluated when updating/adding new objects via the admin
> interface. What I mean by this is:
>
> The workout "1" was changed successfully.
>
> Instead of:
>
> The workout "Running" was changed successfully.
>
> The field in question is an IntegerField with a choices tuple defined
> that looks like:
>
> WORKOUT_TYPE_CHOICES = (
>   (0, "Biking"),
>   (1, "Running"),
> )
>
> The class' __str__ method looks like this:
> return self.get_activity_type_display()
>
> Any ideas?
--~--~-~--~~~---~--~~
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: Pass extra data to a view

2008-05-03 Thread Mike Chambers

Could you just specify the data in the URL that you redirect to?

mike

Jay Parlar wrote:
> On 5/2/08, Jay Parlar <[EMAIL PROTECTED]> wrote:
>> I must be missing something super obvious here, but I can't figure out
>>  how to pass data to a new view, from the old one.
>>
>>  For example, I have the following in a view:
>>
>>  categories = [1,2,3]
>>  return HttpResponseRedirect(
>> reverse('question-select',
>>
>>  args=[position_id],kwargs={'categories':categories}))
>>
>>
>>  A URL pattern of:
>>
>>  url(r'^(?P\d+)/question-select/$',
>>  choose_questions,kwargs={'categories':None}, name='question-select' ),
>>
>>
>>  And a 'choose_questions' view of:
>>
>>  def choose_questions(request, position_id, categories=None):
>> ...
>>
>>
>>  I would *love* to have the value of 'categories' in 'choose_questions'
>>  be [1,2,3], the value I passed to reverse(). However, this isn't
>>  happening. What, if any, is the proper way to pass extra context to a
>>  view like this?
> 
> 
> Wait a sec, I'm crazy, aren't I... The call to HttpResponseRedirect is
> just going to tell the browser to redirect to a new URL, so there's no
> direct calling of the view function. Oops.
> 
> If anyone has a better way to do it, I'd like to hear. I guess for now
> I'll use sessions.
> 
> Jay P.
> 
> > 

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---