Re: Which database is better for django, PostgreSQL or MYSQL?

2007-07-11 Thread Michael Radziej

On Thu, Jul 12, Kenneth Gonsalves wrote:

> 
> 
> On 12-Jul-07, at 6:45 AM, nick feng wrote:
> 
> > Which database is better for django, PostgreSQL or MYSQL?
> 
> postgresql - general, not for django in particular

mysql does not support django fixtures (unless you use the ISAM storage
engine in mysql, and then you don't have transactions).

Michael

--~--~-~--~~~---~--~~
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 & Amazon (SOAP)

2007-07-11 Thread Jeremy Dunck

On 7/11/07, Justin Lilly <[EMAIL PROTECTED]> wrote:
>
> Hey all. I'm trying to play around with API's and I wanted to tap into
> Amazon's to get book listings.

I'm not sure what this has to do with Django.

> The problem is that when I search for
> "python" in books, only 2/5ths of the results actually have to do with
> Python.

Are you logged into Amazon while searching?  They personalize results.

Also, it's likely that the soap search includes fields that the web
search doesn't.

--~--~-~--~~~---~--~~
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 when None displays None

2007-07-11 Thread Nathan Ostgard

It's the default behavior of Python:

>>> str(None)
'None'

I don't agree that it should be the default. None and "" are two
distinct values -- especially with a database. In databases, None (or
NULL) normally represents a _missing_ value, whereas a "" is one that
was intentionally specified to be blank.

On Jul 11, 6:12 pm, Rand  Bradley <[EMAIL PROTECTED]> wrote:
> The default_if_none filter was not working when I tried it the first
> time, but I retried it after your post and it is working so this may
> solve my issue.
>
> Is that the designed behavior template variables? If the value is
> None, display the word "None"? So someone has to use the
> default_if_none filter or use a conditional expression in order to
> render an empty string for all variables that have the potential value
> of None? In my opinion, this seems counter-intuitive, and a better
> approach might be to render an empty string by default, and use the
> default_if_none filter to render the word 'None' if desired.
>
> On Jul 11, 4:15 pm, "Chris Brand" <[EMAIL PROTECTED]> wrote:
>
> > When a template variable value is None, is it expected to render the word
> > 'None'? I would expect this to fail silently instead of displaying the word.
> > Is there a configuration setting or some way to change the default
> > rendering? Do I have to wrap variables with an {% if ... %} in order to not
> > display None? I would appreciate any suggestions on how to handle the
> > display of variables equal to None.
>
> > Are you looking for this :
>
> >http://www.djangoproject.com/documentation/templates/#default-if-none
>
> > 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: Graphs and django

2007-07-11 Thread Ben Ford
Hi Toby,
My versions are:
R:2.4.0
Python:   2.5.1
Rpy:1.0-RC2

Sorry I wasn't very clear earlier... I imported r into ipython to have a
play with it and see what happens. I tried getattr(r,' generic.scatter.plot')
which didn't work - I'm under the impression that getattr won't work with
dotted notation like that if you're doing normal object lookup, am I right
in saying that r does it differently to python? So i tried getattr(r,
'generic') and that didn't work either. The error I get is:
> Error in get(x, envir, mode, inherits) : variable "generic.time.series"
was not found
I tried it with underscores too and I got exactly the same message...

In fact just having looked through the source and having a play with rpy it
seems that there are bugs all over the place:

>>> from rpy import r
RHOME= /usr/lib/R
RVERSION= 2.4.0
RVER= 2040
RUSER= /home/ben
Loading Rpy version 2040 .. Done.
Creating the R object 'r' ..  Done
>>> r
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.5/site-packages/rpy.py", line 307, in __repr__
Rver = self.__getitem__('R_version_string')
  File "/usr/lib/python2.5/site-packages/rpy.py", line 290, in __getitem__
obj = self.__dict__[name] = self.__dict__.get(name, self.get(name))
rpy.RException: Error in get(x, envir, mode, inherits) : variable
"R_version_string" was not found

It looks like the logic in R.__getattr__ isn't working properly! I'll
reinstall it at some point and see how it works :-)
Cheers
Ben

On 12/07/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
>
>
> Hi Ben,
>
> I'm excited to hear that you got a copy of django.contrib.dataplot and you
> are trying it out. I will try to help you debug the problem, but the
> full traceback may be more useful. Can you send it?
>
> The purpose of the get_r_fun method is to look at the current R
> environment and check if the desired R function has been source'ed yet.
> This is one of the first steps before passing the data before R.
>
> I take the "r has no attribute generic" to refer to one of the generic
> plotting functions named in one of the RPlot subclasses -- you must be
> dealing with Scatter, TimeSeries, or NormalQQPlot, right? Are you sure it
> doesn't say something like "r has no attribute generic.scatter.plot"? You
> might try changing the dots . to underscores _ in the
> r_fun_name='generic.scatter.plot' line in the definition of the
> ScatterPlot subclass.
>
> Maybe your version of RPy isn't translating python names into R names the
> same way as mine is? I'm using RPy 0.4.6-3ubuntu2 Python 2.4.2-0ubuntu3
> and R 2.2.1-2 on ubuntu dapper. What are your versions?
>
> Sincerely,
> Toby Dylan Hocking
> http://www.ocf.berkeley.edu/~tdhock
>
> On Wed, 11 Jul 2007, Ben Ford wrote:
>
> > Hi Toby
> > I've grabbed a copy of your code but the RPlot.get_r_fun method isn't
> > working for me... Could you perhaps explain how it does the mapping to
> the R
> > function? What my testing is saying to me is that r (the one that's
> imported
> > at the top of __init__.py) has no attribute generic... I've had a very
> brief
> > look at rpy before, but I'm not exactly familiar with it's inner
> > workings
> > Great work, I've been meaning to have a crack at something like this for
> > ages!!
> > Ben
> >
> > On 11/07/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> Hi there,
> >>
> >> If you still need help with making data-driven plots, why don't you
> check
> >> out my new Django package --- I'd like some testers and comments.
> >> Basically it is an interface to the R programming language (for
> statistics
> >> and graphics) through the RPy package. You can download my latest
> release:
> >>
> >> http://www.ocf.berkeley.edu/~tdhock/dataplot-0.2.tgz
> >>
> >> I'm a statistician who has been using this system for some time at my
> >> work, but I finally am getting around to generalizing it and packaging
> it
> >> for general use with the Django framework.
> >>
> >> The installation instructions are in INSTALL.txt in the archive.
> >> Documentation is mostly present in docstrings at the moment -- I'm
> working
> >> on more tutorials, but the .txt files and the example app should be
> enough
> >> to get you started.
> >>
> >> Sincerely,
> >> Toby Dylan Hocking
> >> http://www.ocf.berkeley.edu/~tdhock
> >>
> >>
> >>>
> >>
> >
> >
> > --
> > Regards,
> > Ben Ford
> > [EMAIL PROTECTED]
> > +628111880346
> >
> > >
> >
>
> >
>


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

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

case sensitive usernames

2007-07-11 Thread mike


Hi all,

While I was writing test cases for my upcoming website, I noticed I that
the contrib.auth module will happily make a user called Mike and user
called mike and treat them as two separate users.

Are there reasons for this? I patched my installation of django so that
usernames were not case sensitive. My reasoning was that someone could
register as Neil (lowercase L at the end) and build up a reputation on
the site. Then someone could register as NeiI (uppercase i at the end)
and impersonate the first user, as in many fonts the glyphs for
lowercase L and uppercase i are identical.

Also, giving users a slug using the standard django slugify becomes
problematic if you have Neil and neil. Which one does the slug "neil"
refer to?

Cheers,

MikeH

--~--~-~--~~~---~--~~
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: session in all templates?

2007-07-11 Thread Russell Keith-Magee

On 7/12/07, Martin Kaffanke <[EMAIL PROTECTED]> wrote:
> At the moment I use on some places a
>
> {'session': request.session} for the Context to render the template.
> How Can I make the session automaticaly available in the base template,
> without having to be aware that I don't forgett this parameter for the
> Context?

Install the request context processor. In your settings file, define

TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.request',
)

(This is the default value, plus the request context processor)

Then, every RequestContext will have a 'request' variable automatically. See

http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext

for more details.

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: Which database is better for django, PostgreSQL or MYSQL?

2007-07-11 Thread Kenneth Gonsalves


On 12-Jul-07, at 6:45 AM, nick feng wrote:

> Which database is better for django, PostgreSQL or MYSQL?

postgresql - general, not for django in particular

-- 

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: Site framework

2007-07-11 Thread Russell Keith-Magee

On 7/11/07, Glebb <[EMAIL PROTECTED]> wrote:
>
> Hi, I'm trying to use the site framework, and it works, but I just
> have one problem. I have a form (from form_for_model for example)
> which represents an object which has a site foreign key. The site
> selection shows up just fine in the form. But when I try to submit it,
> it complains about the site_id being null (event though the site
> variable in request.POST is correct, site id that is). Am I doing
> something wrong or how I'm supposed to accomplish this?

I'm not aware of anything that would be causing this sort of problem.
To help you debug, we will need to see some actual code - 'it
complains' isn't really that helpful as debugging information.

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: newforms-admin character encoding problem

2007-07-11 Thread leifbyron

£,¥ and other non-ASCII symbols are working perfectly on the latest
newforms-admin. Thanks, 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: Generating graphs from db data and displaying results using Django?

2007-07-11 Thread Toby Dylan Hocking

Thanks for the input, Jeremy. I'd definitely be open to using PIL instead 
of ImageMagick. django.contrib.dataplot use of ImageMagick is relatively 
simple: taking vector PDFs drawn in R and converting them to fullscreen 
and thumbnail raster PNGs.

Do you know of a way that PIL can be used to convert PDF to PNG? A quick 
google search reveals this pdf 
(http://www.pythonware.com/media/data/pil-handbook.pdf) which suggests 
that PIL is only capable of writing PDFs (p69).

What I meant by
>> general enough to handle several different backend
>> plotting languages, such as matplotlib, pil, octave,
was that if a Django app wanted to use pil to draw the initial PDF (rather 
than R), then the django.contrib.dataplot framework is perfectly 
extensible for that purpose (not with current 0.2 release, but these 
generalized plotting backends are a planned feature for my next release, 
0.3).

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Wed, 11 Jul 2007, Jeremy Dunck wrote:

>
> On 7/11/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
>
> How hard would it be to depend on PIL rather than ImageMagick?  I'm
> asking because Django already requires PIL if you want ImageField, and
> it's a shame to depend on both.
>
> (I know there are different features in each and you may have a good
> reason for choosing Magick.)
>
> >

--~--~-~--~~~---~--~~
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: avoiding 'matching query not exist'

2007-07-11 Thread James Bennett

On 7/11/07, Carl Karsten <[EMAIL PROTECTED]> wrote:
> Huh.  I would have expected this case would have been provided for.

No, the raising of the exception is quite deliberate on Django's part
-- when you use a method which is expected to return one and only one
object, Django has only two options:

1. Return the one, and only one, object, or
2. Raise an exception saying it couldn't do that.

Any other option introduces ambiguity and guesswork, and we don't want that.

If it can't do what you've asked, Django will raise one of these exceptions:

* If there is no such object, you'll get a model-specific subclass of
ObjectDoesNotExist.

* If there's more than one such object (e.g., you used 'get()' and the
supplied parameters matched multiple objects) you'll get an
AssertionError.

Internally, the various database querying methods Django exposes will
do their best to catch any possible exceptions and raise one of the
above two instead. This means that you have a consistent interface to
your data -- if you ask for something that isn't possible, you know
exactly what you're going to get and you don't have to guess about
exception types or empty return values.

The only time you won't get an exception is if you do something in a
template which would raise an ObjectDoesNotExist -- because the
template system explicitly advertises silent failure on
method/attribute access, ObjectDoesNotExist is treated specially and
fails silently.

So, for example, if you had this model:

class Entry(models.Model):
title = models.CharField(maxlength=250)
body = models.TextField()
pub_date = models.DateTimeField()

and only had one object of that model, you'd see one behavior in pure Python:

>>> e = Entry.objects.get(pk=1)
>>> e.get_previous_by_pub_date()
...(ObjectDoesNotExist gets raised here)...

But in a template the exception gets quashed, which means you can do
things like:

{% if e.get_previous_by_pub_date %}
The previous entry is {{ e.get_previous_by_pub_date.title }}.
{% else %}
This is the first entry.
{% endif %}

and not have to worry in your template about whether that's going to
raise an exception.


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



Which database is better for django, PostgreSQL or MYSQL?

2007-07-11 Thread nick feng
Which database is better for django, PostgreSQL or MYSQL?
--~--~-~--~~~---~--~~
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 when None displays None

2007-07-11 Thread Rand Bradley

The default_if_none filter was not working when I tried it the first
time, but I retried it after your post and it is working so this may
solve my issue.

Is that the designed behavior template variables? If the value is
None, display the word "None"? So someone has to use the
default_if_none filter or use a conditional expression in order to
render an empty string for all variables that have the potential value
of None? In my opinion, this seems counter-intuitive, and a better
approach might be to render an empty string by default, and use the
default_if_none filter to render the word 'None' if desired.

On Jul 11, 4:15 pm, "Chris Brand" <[EMAIL PROTECTED]> wrote:
> When a template variable value is None, is it expected to render the word
> 'None'? I would expect this to fail silently instead of displaying the word.
> Is there a configuration setting or some way to change the default
> rendering? Do I have to wrap variables with an {% if ... %} in order to not
> display None? I would appreciate any suggestions on how to handle the
> display of variables equal to None.
>
> Are you looking for this :
>
> http://www.djangoproject.com/documentation/templates/#default-if-none
>
> 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: Generating graphs from db data and displaying results using Django?

2007-07-11 Thread Jeremy Dunck

On 7/11/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
> general enough to handle several different backend
> plotting languages, such as matplotlib, pil, octave,

How hard would it be to depend on PIL rather than ImageMagick?  I'm
asking because Django already requires PIL if you want ImageField, and
it's a shame to depend on both.

(I know there are different features in each and you may have a good
reason for choosing Magick.)

--~--~-~--~~~---~--~~
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: Graphs and django

2007-07-11 Thread Jeremy Dunck

On 7/11/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
> If you still need help with making data-driven plots, why don't you check
> out my new Django package --- I'd like some testers and comments.

Initial reaction-- sweet!

After linking dataplot into my contribs dir and adding both dataplot
and dataplot.bike in my INSTALLED_APPS, I get this:

[EMAIL PROTECTED]:~/work/pegasus/b-schools$ ~/django-admin.py syncdb
RHOME= /usr/lib/R
RVERSION= 2.4.1
RVER= 2041
RUSER= /home/jdunck
Loading Rpy version 2041 .. Done.
Creating the R object 'r' ..  Done
Error: Couldn't install apps, because there were errors in one or more models:
bike.ride: "distance": FloatFields require a "decimal_places" attribute.


A quick check indicates that this is because of a backwards incompat in Django:
http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#RenamedFloatFieldtoDecimalField

I guess you're running on latest trunk?

--~--~-~--~~~---~--~~
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: Generating graphs from db data and displaying results using Django?

2007-07-11 Thread Toby Dylan Hocking

You guys should definitely check my new framework for making data-driven 
plots with Django (installation instructions in INSTALL.txt):

http://www.ocf.berkeley.edu/~tdhock/dataplot-0.2.tgz

So far django.contrib.dataplot only uses the R programming language to 
generate images server-side, but the great part (as yet undocumented) is 
that it is compatible general enough to handle several different backend 
plotting languages, such as matplotlib, pil, octave, etc.

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Wed, 11 Jul 2007, Vincent Nijs wrote:

>
> http://www.scipy.org/Cookbook/Matplotlib/Django
>
> On 7/11/07 12:06 PM, "Forest Bond" <[EMAIL PROTECTED]> wrote:
>
>> On Wed, Jul 11, 2007 at 04:56:03PM -, [EMAIL PROTECTED] wrote:
>>>
>>> I would actually suggest using Django to create a web service to get
>>> the data, and a JavaScript charting library to do the drawing client-
>>> side.
>>
>> Why not create the graphs on the server?
>>
>> -Forest
>
>
>
> >

--~--~-~--~~~---~--~~
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: When I POST, it tells me connection was reset while page was loading

2007-07-11 Thread Luke

On some investigation, I found this:
http://code.djangoproject.com/ticket/3089
and this
http://code.djangoproject.com/ticket/3496

but this happens to me no matter what (at least with firefox). It's
fine in IE6

On Jul 11, 5:11 pm, Luke <[EMAIL PROTECTED]> wrote:
> I just set up my first django development site and I'm developing it
> with the dev server. I just set up my first form. It works the first
> time, but each subsequent time, it tells me that the connection was
> reset while the page was loading. If I kill the dev server and
> manage.py runserver again, it will post once, and then from there on
> out if I post it will say "the connection was reset while the page was
> loading" and I can't post any more. I can go to any page I like, but I
> Can't post. This is driving me insane... why would it be doing 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
-~--~~~~--~~--~--~---



Re: How to execute an external application from View

2007-07-11 Thread RayLeyva



On Jul 8, 11:54 pm, Knut Ivar Nesheim <[EMAIL PROTECTED]> wrote:
> A working workaround:
> If javascript is an option, have a look at this: http://
> developer.yahoo.com/yui/examples/container/panelwait/1.html

Knut,

Thanks for the great idea, and I'll definitely dig deeper into it if
for no other reason than adding AJAX ui to my project is high on my
Todo list, and the Yahoo UI looks fairly cool!

Unfortunately I'm stuck in the dark ages, and haven't yet settled on
an AJAX / ui toolkit to try to use.  I'm hoping that DJANGO picks one,
and makes it the default soon! Thereby eliminating any need for me to
learn one, and then learn yet-another-ajax-toolkit later on when they
do pick one.  :-)

As to my particular problem, I just went with a tried a true solution,
and split out the time consuming stuff over to an xmlrpc server, and I
just have the view call the xmlrpc server to start the process, and
since I don't really "care" about the return ( good or bad ) I
immediately return the control to the Django view, and go from there.

Thanks,
Ray


--~--~-~--~~~---~--~~
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 I POST, it tells me connection was reset while page was loading

2007-07-11 Thread Luke

I just set up my first django development site and I'm developing it
with the dev server. I just set up my first form. It works the first
time, but each subsequent time, it tells me that the connection was
reset while the page was loading. If I kill the dev server and
manage.py runserver again, it will post once, and then from there on
out if I post it will say "the connection was reset while the page was
loading" and I can't post any more. I can go to any page I like, but I
Can't post. This is driving me insane... why would it be doing 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
-~--~~~~--~~--~--~---



Re: Graphs and django

2007-07-11 Thread Toby Dylan Hocking

Hi Ben,

I'm excited to hear that you got a copy of django.contrib.dataplot and you 
are trying it out. I will try to help you debug the problem, but the 
full traceback may be more useful. Can you send it?

The purpose of the get_r_fun method is to look at the current R 
environment and check if the desired R function has been source'ed yet. 
This is one of the first steps before passing the data before R.

I take the "r has no attribute generic" to refer to one of the generic 
plotting functions named in one of the RPlot subclasses -- you must be 
dealing with Scatter, TimeSeries, or NormalQQPlot, right? Are you sure it 
doesn't say something like "r has no attribute generic.scatter.plot"? You 
might try changing the dots . to underscores _ in the 
r_fun_name='generic.scatter.plot' line in the definition of the 
ScatterPlot subclass.

Maybe your version of RPy isn't translating python names into R names the 
same way as mine is? I'm using RPy 0.4.6-3ubuntu2 Python 2.4.2-0ubuntu3 
and R 2.2.1-2 on ubuntu dapper. What are your versions?

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock

On Wed, 11 Jul 2007, Ben Ford wrote:

> Hi Toby
> I've grabbed a copy of your code but the RPlot.get_r_fun method isn't
> working for me... Could you perhaps explain how it does the mapping to the R
> function? What my testing is saying to me is that r (the one that's imported
> at the top of __init__.py) has no attribute generic... I've had a very brief
> look at rpy before, but I'm not exactly familiar with it's inner
> workings
> Great work, I've been meaning to have a crack at something like this for
> ages!!
> Ben
>
> On 11/07/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi there,
>>
>> If you still need help with making data-driven plots, why don't you check
>> out my new Django package --- I'd like some testers and comments.
>> Basically it is an interface to the R programming language (for statistics
>> and graphics) through the RPy package. You can download my latest release:
>>
>> http://www.ocf.berkeley.edu/~tdhock/dataplot-0.2.tgz
>>
>> I'm a statistician who has been using this system for some time at my
>> work, but I finally am getting around to generalizing it and packaging it
>> for general use with the Django framework.
>>
>> The installation instructions are in INSTALL.txt in the archive.
>> Documentation is mostly present in docstrings at the moment -- I'm working
>> on more tutorials, but the .txt files and the example app should be enough
>> to get you started.
>>
>> Sincerely,
>> Toby Dylan Hocking
>> http://www.ocf.berkeley.edu/~tdhock
>>
>>
>>>
>>
>
>
> -- 
> Regards,
> Ben Ford
> [EMAIL PROTECTED]
> +628111880346
>
> >
>

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



Template variable when None displays None

2007-07-11 Thread Rand Bradley
When a template variable value is None, is it expected to render the word
'None'? I would expect this to fail silently instead of displaying the word.
Is there a configuration setting or some way to change the default
rendering? Do I have to wrap variables with an {% if ... %} in order to not
display None? I would appreciate any suggestions on how to handle the
display of variables equal to None.

Thanks, Rand

--~--~-~--~~~---~--~~
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 when None displays None

2007-07-11 Thread Chris Brand
When a template variable value is None, is it expected to render the word
'None'? I would expect this to fail silently instead of displaying the word.
Is there a configuration setting or some way to change the default
rendering? Do I have to wrap variables with an {% if ... %} in order to not
display None? I would appreciate any suggestions on how to handle the
display of variables equal to None. 


Are you looking for this :

http://www.djangoproject.com/documentation/templates/#default-if-none

 

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



www.OutpatientSurgicare.com/video/

2007-07-11 Thread dvd_km

www.OutpatientSurgicare.com/video/
Outpatient Doctors Surgery Center is committed to offering the
healthcare the community needs. We offer patients a meaningful
alternative to traditional surgery. This state-of-the-art outpatient
surgery center, located in the heart of Orange County, at 10900 Warner
Avenue, Suite 101A, Fountain Valley, Ca 92708, offers the latest
innovations in outpatient surgery and technology.
Please Call For Our Special Cash Discount
Toll Free: 1-877-500-2525
Please Visit Our Websites:
We offer extreme cosmetic surgery makeover packages.
http://www.SurgeonToTheStars.com
http://www.1cosmeticsurgery.com
Specializing in the cure of hyperhidrosis, sweaty palms, underarm and
foot sweating.
http://www.CuresweatyPalms.com
http://www.ControlExcessiveSweating.com
No. 1 Weight Loss Surgery Center
http://www.ControlWeightLossNow.com
http://www.FreeLapBandSeminar.com
Hernia Treatment Center
http://www.HerniaDoc.com
Take care of your feet
http://www.CureFootPain.com
The Experts in CARPAL TUNNEL SYNDROME
http://www.CureHandPain.com

Accidental Urine Leaks ? End Urinary Incontinence
http://www.WomanWellnessCenter.com
Hemorrhoid Treatment Center
http://www.hemorrhoidtreatmentcenter.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
-~--~~~~--~~--~--~---



Is there any way to custom group models in the admin panel?

2007-07-11 Thread Sebastian Macias

By default models are grouped by app. I really need to be able to
break down that grouping a little bit more. I will have an app with
probably 40-50 models and would like to group those logically instead
of having them all listed under my app name.

Thanks,

Sebastian


--~--~-~--~~~---~--~~
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: Object list generic view + list

2007-07-11 Thread Drasty

Have you tried using the http://www.djangoproject.com/
documentation/db-api/#order-by-fields">order_by method on your
queries?

Even though it may get cumbersome, you could also add something along
these lines to your url.py file for each specific query you might want
to call:

def some_list():
 return Model.objects.all().order_by('some_field')


--~--~-~--~~~---~--~~
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: new django site: PotterPredictions.com

2007-07-11 Thread Carl Karsten

Kai Kuehne wrote:
> Well, I meant without to register myself on the site.

in case it isn't crystal clear:

http://www.codinghorror.com/blog/archives/000881.html
"Removing The Login Barrier"

Carl 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: new django site: PotterPredictions.com

2007-07-11 Thread Dennis Allison


http://www.potterpredictions.com

returns

"Site not configured'

whereas 

http://potterpredictions.com

takes you to content.



On Wed, 11 Jul 2007, Kai Kuehne wrote:

> 
> Hi James,
> 
> On 7/11/07, James Tauber <[EMAIL PROTECTED]> wrote:
> >
> > Django users might be interested in my lastest django-based website:
> > http://PotterPredictions.com/ which allows people to record their
> > predictions of what will be revealed in the final Harry Potter book,
> > compare with friends and then ultimately (after July 21st) find out who
> > got the most things correct.
> 
> I don't like Harry Potter but I would like to see the site without 
> registration.
> Is that possible? :)
> 
> > 

-- 


--~--~-~--~~~---~--~~
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: new django site: PotterPredictions.com

2007-07-11 Thread Kai Kuehne

Well, I meant without to register myself on the site.
Sorry if that was confusing.

--~--~-~--~~~---~--~~
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: new django site: PotterPredictions.com

2007-07-11 Thread Kai Kuehne

Hi James,

On 7/11/07, James Tauber <[EMAIL PROTECTED]> wrote:
>
> Django users might be interested in my lastest django-based website:
> http://PotterPredictions.com/ which allows people to record their
> predictions of what will be revealed in the final Harry Potter book,
> compare with friends and then ultimately (after July 21st) find out who
> got the most things correct.

I don't like Harry Potter but I would like to see the site without registration.
Is that possible? :)

--~--~-~--~~~---~--~~
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: avoiding 'matching query not exist'

2007-07-11 Thread Carl Karsten

James Bennett wrote:
> On 7/11/07, Carl Karsten <[EMAIL PROTECTED]> wrote:
>> How can I do something similar with:
>>  coursestatus = Event.objects.filter(
>>eventtype__eventcode='corsecond',
>>eventdate__lt = datetime.now()
>>).latest('eventdate')
>>
>> Currently I get " Event matching query does not exist. "
> 
> As you should -- when there is no object matching the parameters
> you've passed, 'latest()' raises ObjectDoesNotExist (specifically in
> this case, the subclass Event.DoesNotExist).
> 
> What you want is to wrap a try/except block around that, like so:
> 
> try:
> coursestatus = Event.objects.filter(...your params...).latest()
> except Event.DoesNotExist:
> coursestatus = None
> 

Huh.  I would have expected this case would have been provided for.

Thanks for giving me the exception to catch, I would have just left it open 
thinking I would figure it out someday, and that day would only come when I am 
going nuts trying to figure out why some error is being suppressed.

Carl 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: avoiding 'matching query not exist'

2007-07-11 Thread James Bennett

On 7/11/07, Carl Karsten <[EMAIL PROTECTED]> wrote:
> How can I do something similar with:
>  coursestatus = Event.objects.filter(
>eventtype__eventcode='corsecond',
>eventdate__lt = datetime.now()
>).latest('eventdate')
>
> Currently I get " Event matching query does not exist. "

As you should -- when there is no object matching the parameters
you've passed, 'latest()' raises ObjectDoesNotExist (specifically in
this case, the subclass Event.DoesNotExist).

What you want is to wrap a try/except block around that, like so:

try:
coursestatus = Event.objects.filter(...your params...).latest()
except Event.DoesNotExist:
coursestatus = None

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



avoiding 'matching query not exist'

2007-07-11 Thread Carl Karsten


This deals with empty sets:

 dinner_special = Event.objects.filter(
   eventtype__eventcode='restspec',
   eventdate = datetime.now() )

 Today's Dinner Secials:
 {% if  dinner_special %}
   {{ dinner_special.0.title }}{{ dinner_special.0.description }}
 {% else %}
   Sorry, nothing posted for today.
 {% endif %}


How can I do something similar with:

 coursestatus = Event.objects.filter(
   eventtype__eventcode='corsecond',
   eventdate__lt = datetime.now()
   ).latest('eventdate')

Currently I get " Event matching query does not exist. "

Carl 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: DRY violation

2007-07-11 Thread Aidas Bendoraitis

Use the pre_save signal.

Write something like the following into some models.py file:

from django.dispatch import dispatcher
def attach_user_to_object(sender, instance, signal, *args, **kwargs):
# sender - the model which instance is being saved
# instance - the instance being saved
# ... assign the user to the instance if it has the created_by field ...
dispatcher.connect(attach_user_to_object, signal=signals.pre_save)

Regards,
Aidas Bendoraitis




On 7/11/07, Norjee <[EMAIL PROTECTED]> wrote:
>
> Use the events framework. I'm sure there is a pre-save event. Use it
> to execute one (DRY) method  and attach it to all your models.
>
> I personally would just write a custom method (your custom
> attach_user_to_model), which I'd call in all the save methods of the
> models.. But I guess attaching evenents might make you feel more dry.
> On the other hand, is writing rather obscure code really better than
> adding the followin code to your models:
> --
> def save(self):
>   attach_user_to_model(self)
> ---
>
>
> >
>

--~--~-~--~~~---~--~~
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: saving many2many relations

2007-07-11 Thread RajeshD

Hi,

> Anyone knows where the problem is?

If you are using the Admin app to populate tags then the automatic
manipulators first call Receta.save() followed by setting the models
M2M field. This wipes out your changes to etiquetas inside
Receta.save()

One solution is to add get_tags and set_tags methods to Receta and do
a lazy initialization of your M2M field i.e. if get_tags finds that
self.etiquetas.all() is empty, it first populates self.etiquetas.
Then, for brownie points, wrap the get_tags and set_tags methods
around a property so you can do straight assignments.

-Rajesh



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



Direct Client - Sr.Soft Engineer-Python and Linux

2007-07-11 Thread Kan

Hello,


We have requirement for Sr.Software Engineer in San Jose CA with very
strong experinece in PYTHON AND LINUX .  If your skills and experience
matches with the same, send me your resume asap with contact # and
rate.
Locals only pls apply

The details of the openings are:-
Strong in Python and Linux
Good in Java C++


Kan
BTech Inc
Recruiter
510-438-6834
www.tbiinc.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: session in all templates?

2007-07-11 Thread Chris Hoeppner

Martin Kaffanke escribió:
> Am Mittwoch, den 11.07.2007, 13:34 -0400 schrieb Simon Drabble:
>> On Wed, 11 Jul 2007, Martin Kaffanke wrote:
>>
>>> Am Mittwoch, den 11.07.2007, 12:26 -0400 schrieb Simon Drabble:
 On Wed, 11 Jul 2007, Martin Kaffanke wrote:

> Hi there!
>
> How can I configure django to put the session (request.session) in all
> templates?
>
> I want to put a 'Hello Username' for logged in Users, and I want to do a
> dynamic login/logout button into the menu, depends on if there is a
> logged in user or not.
>
> Thanks,
> Martin
>
 Extend your templates from a common base, with the session info in the 
 base.
>>> Hum, I do not really understand what you mean... any links?
>>>
>>> Thanks,
>>> Martin
>>>
>> Start here:
>>
>> http://www.djangoproject.com/documentation/templates/
>>
>> Particularly:
>>
>> http://www.djangoproject.com/documentation/templates/#extends
> 
> Ok, I knew this already, but I think my problem is a bit different.
> 
> At the moment I use on some places a 
> 
> {'session': request.session} for the Context to render the template.
> How Can I make the session automaticaly available in the base template,
> without having to be aware that I don't forgett this parameter for the
> Context?
> 
> Thanks,
> Martin

I know it's not my problem, but you might consider that there might be a 
'why' for the session data not being in the template by default. 
Anyways, have a look at the auth middleware. It puts the user var into 
the templates, and that's just what you need.

However, I'd prefer to inject the needed vars manually in the view. You 
know... Business logic and all that stuff. ;)

Kind regards,
Chris Hoeppner
www.pixware.or

BTW: Extending a template does not "extend" the values of the vars, as 
they're assigned by the view on each request, AFAIK.

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



Part time tech writers wanted - 2 positions work from anywhere

2007-07-11 Thread techhairball

Please visit http://www.TechHairBall.com for more info. Any thing
related with technology will work.


--~--~-~--~~~---~--~~
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: session in all templates?

2007-07-11 Thread Martin Kaffanke
Am Mittwoch, den 11.07.2007, 13:34 -0400 schrieb Simon Drabble:
> On Wed, 11 Jul 2007, Martin Kaffanke wrote:
> 
> > Am Mittwoch, den 11.07.2007, 12:26 -0400 schrieb Simon Drabble:
> >> On Wed, 11 Jul 2007, Martin Kaffanke wrote:
> >>
> >>> Hi there!
> >>>
> >>> How can I configure django to put the session (request.session) in all
> >>> templates?
> >>>
> >>> I want to put a 'Hello Username' for logged in Users, and I want to do a
> >>> dynamic login/logout button into the menu, depends on if there is a
> >>> logged in user or not.
> >>>
> >>> Thanks,
> >>> Martin
> >>>
> >>
> >> Extend your templates from a common base, with the session info in the 
> >> base.
> >
> > Hum, I do not really understand what you mean... any links?
> >
> > Thanks,
> > Martin
> >
> 
> Start here:
> 
> http://www.djangoproject.com/documentation/templates/
> 
> Particularly:
> 
> http://www.djangoproject.com/documentation/templates/#extends

Ok, I knew this already, but I think my problem is a bit different.

At the moment I use on some places a 

{'session': request.session} for the Context to render the template.
How Can I make the session automaticaly available in the base template,
without having to be aware that I don't forgett this parameter for the
Context?

Thanks,
Martin


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: Eclipse and PyDev setup

2007-07-11 Thread Jacob Kaplan-Moss

HI Fred --

In the future, please don't cross-post to django-users and django-dev;
django-dev is used to discuss the development of Django itself, not to
answer usage questions.

Thanks!

Jacob

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



threadlocals in Manager, import-time vs. execution-time problem?

2007-07-11 Thread Nathaniel Whiteinge

I'm having a problem with threadlocals in a custom manager making
queries for the wrong user. I've Googled around quite a bit, and
haven't found the answer -- except others *do* seem to be successfully
using threadlocals in Managers. Ostensibly this is a import-time vs.
execution-time problem, but I'm not sure. Can someone identify my
folly?

class PickManager(models.Manager):
def get_query_set(self):
return super(PickManager,
self).get_query_set().select_related()

def history(self):
return self.filter(user=threadlocals.get_current_user())


--~--~-~--~~~---~--~~
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: manually accessing initial value for field

2007-07-11 Thread Chris Hoeppner

Hi there!

I was just wondering how to access the value I've set in the view with 
Form(initial={'val':somevar}) in the template. Maybe field.value? No. 
field.initial? No.

Any clues? 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
-~--~~~~--~~--~--~---



new django site: PotterPredictions.com

2007-07-11 Thread James Tauber

Django users might be interested in my lastest django-based website:
http://PotterPredictions.com/ which allows people to record their
predictions of what will be revealed in the final Harry Potter book,
compare with friends and then ultimately (after July 21st) find out who
got the most things correct.

Conception to launch took only 72hrs, thanks to Django (and
WebFaction.com)

Check it out and, if you're a Harry Potter fan, make some predictions!

I'm adding some more features but at some stage (after July 21st) I'll
factor out some of the non-domain-specific parts into separate apps and
make them available open source.

James
-- 
  James Tauber   http://jtauber.com/
  journeyman of somehttp://jtauber.com/blog/


--~--~-~--~~~---~--~~
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-admin: defaults and radio select

2007-07-11 Thread leifbyron

Hey Allen -- Any luck?



--~--~-~--~~~---~--~~
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: session in all templates?

2007-07-11 Thread Simon Drabble

On Wed, 11 Jul 2007, Martin Kaffanke wrote:

> Am Mittwoch, den 11.07.2007, 12:26 -0400 schrieb Simon Drabble:
>> On Wed, 11 Jul 2007, Martin Kaffanke wrote:
>>
>>> Hi there!
>>>
>>> How can I configure django to put the session (request.session) in all
>>> templates?
>>>
>>> I want to put a 'Hello Username' for logged in Users, and I want to do a
>>> dynamic login/logout button into the menu, depends on if there is a
>>> logged in user or not.
>>>
>>> Thanks,
>>> Martin
>>>
>>
>> Extend your templates from a common base, with the session info in the base.
>
> Hum, I do not really understand what you mean... any links?
>
> Thanks,
> Martin
>

Start here:

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

Particularly:

http://www.djangoproject.com/documentation/templates/#extends

-Simon.

--~--~-~--~~~---~--~~
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: session in all templates?

2007-07-11 Thread Martin Kaffanke
Am Mittwoch, den 11.07.2007, 12:26 -0400 schrieb Simon Drabble:
> On Wed, 11 Jul 2007, Martin Kaffanke wrote:
> 
> > Hi there!
> >
> > How can I configure django to put the session (request.session) in all
> > templates?
> >
> > I want to put a 'Hello Username' for logged in Users, and I want to do a
> > dynamic login/logout button into the menu, depends on if there is a
> > logged in user or not.
> >
> > Thanks,
> > Martin
> >
> 
> Extend your templates from a common base, with the session info in the base.

Hum, I do not really understand what you mean... any links?

Thanks,
Martin


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: Update in django custom sql

2007-07-11 Thread Dannoo

Tim,

Actually thanks!
Once I put it into a function with the @transaction.commit_manually
decoration and manually commited: it worked fine.

Thanks again,
Dan

On Jul 11, 11:32 am, Dannoo <[EMAIL PROTECTED]> wrote:
> I tried that and got "serialized connection: cannot commit on this
> cursor"
> Also tried close with no results.
>
> On Jul 11, 11:29 am, Tim Chase <[EMAIL PROTECTED]> wrote:
>
> > > I am wondering why does this code does not work. The sql runs fine
> > > fine when executed through the postgres admin.
>
> > > from django.db import connection
>
> > > cursor = connection.cursor()
> > > x = cursor.execute("UPDATE  videos_video SET name = 'Please work'
> > > WHERE videos_video.id = 1; " )
>
> > I know I've butted heads against remembering to commit the
> > transaction when done.  I don't know what your current
> > transaction/commit settings are, but it might not hurt to do a
> > connection.commit() call in there when you're done.
>
> > -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: Generating graphs from db data and displaying results using Django?

2007-07-11 Thread Vincent Nijs

http://www.scipy.org/Cookbook/Matplotlib/Django

On 7/11/07 12:06 PM, "Forest Bond" <[EMAIL PROTECTED]> wrote:

> On Wed, Jul 11, 2007 at 04:56:03PM -, [EMAIL PROTECTED] wrote:
>> 
>> I would actually suggest using Django to create a web service to get
>> the data, and a JavaScript charting library to do the drawing client-
>> side.
> 
> Why not create the graphs on the server?
> 
> -Forest



--~--~-~--~~~---~--~~
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: Generating graphs from db data and displaying results using Django?

2007-07-11 Thread Forest Bond
On Wed, Jul 11, 2007 at 04:56:03PM -, [EMAIL PROTECTED] wrote:
> 
> I would actually suggest using Django to create a web service to get
> the data, and a JavaScript charting library to do the drawing client-
> side.

Why not create the graphs on the server?

-Forest


signature.asc
Description: Digital signature


Re: Generating graphs from db data and displaying results using Django?

2007-07-11 Thread [EMAIL PROTECTED]

I would actually suggest using Django to create a web service to get
the data, and a JavaScript charting library to do the drawing client-
side.  A great one is PlotKit (http://www.liquidx.net/plotkit/)

A (very) simple example of how this could look is on my personal
website http://www.eflorenzano.com/runs/

Note that PlotKit has many methods for dynamically updating the
graph.  I really think that this route is the way to go.

On Jul 10, 3:03 pm, Chris Rich <[EMAIL PROTECTED]> wrote:
> Hey all,
>   So, I'm a beginner here with Django/webdesign/database stuff/all the
> rest of it and I may be getting ahead of myself.  I am currently
> getting my feet wet in the Django environment, but I eventually want
> to graph/calculate averages on some of the values in my database.  I
> would like to display the results in my Django page and maybe even
> make it so I could change some of the graph parameters using some
> simple Django forms.  Any ideas on the best way to go about this?
> Thanks in advance.
>
> 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: session in all templates?

2007-07-11 Thread Simon Drabble

On Wed, 11 Jul 2007, Martin Kaffanke wrote:

> Hi there!
>
> How can I configure django to put the session (request.session) in all
> templates?
>
> I want to put a 'Hello Username' for logged in Users, and I want to do a
> dynamic login/logout button into the menu, depends on if there is a
> logged in user or not.
>
> Thanks,
> Martin
>

Extend your templates from a common base, with the session info in the base.

-Simon

-- 

--~--~-~--~~~---~--~~
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: ForeignKey(User, list_display=full?

2007-07-11 Thread Nathan Ostgard

I really think you should define a custom field and override the
choices. For example:

from django.utils.encoding import smart_unicode
class UserForeignKey(models.ForeignKey):
  def get_choices(self, include_blank=True,
blank_choice=models.BLANK_CHOICE_DASH):
"Returns a list of tuples used as SelectField choices for this
field."
first_choice = include_blank and blank_choice or []
if self.choices:
  return first_choice + list(self.choices)
rel_model = self.rel.to
if hasattr(self.rel, 'get_related_field'):
  lst = [(getattr(x, self.rel.get_related_field().attname),
smart_unicode('%s %s' % (x.first_name, x.last_name))) for x in
rel_model._default_manager.complex_filter(self.rel.limit_choices_to)]
else:
  lst = [(x._get_pk_val(), smart_unicode('%s %s' % (x.first_name,
x.last_name))) for x in
rel_model._default_manager.complex_filter(self.rel.limit_choices_to)]
return first_choice + lst

Then, in your model:

user = UserForeignKey(User)

It's the most effective way to fix your immediate problem.

For a more long term solution, you could define a ChoicesForeignKey
that would look for __choice_str__ and __choices_unicode__ methods on
a model instance, to allow per-model overriding... but that would take
a bit more work.


On Jul 10, 8:45 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
> Russell Keith-Magee wrote:
> > On 7/11/07, Carl Karsten <[EMAIL PROTECTED]> wrote:
>
> >> I am hoping to do something like
> >> contact = models.ForeignKey(User, list_display = ('first_name', 
> >> 'last_name') )
>
> > A big -1 on this idea. This mixes the data representation with the
> > display representation. One of the major reasons for the
> > newforms-admin rewrite is to avoid mixes like this.
>
> Personally, I think this is an appropriate place to do what I am doing.  it 
> is a
> central place where an aspect of my app is defined, and that definition can
> include both the schema and the UI.  the UI can be overridden at the instance
> level, but if there are more than one place this 'default' UI is to be used,
> this seems like the place to define it.
>
> now that I have said all that, I should go look at the newforms-admin thing.  
> so
> don't get too worked up over my "common place to define everything" desire.
>
> > If you want to affect the display of a foreign key, you can (and
> > should) do it on the form. The default display will be __str__, but
> > you can easily replace the display list.
>
> Only interested in the admin interface.  I am not very far into coding my 
> app, I
> have been using SVN.  sounds like I should start using the newforms-admin? (im
> quite ok developing with beta code.  by the time I am ready to deploy I will
> know that either my stuff works, or what bugs are pending and then fix them.  
> or
> something like that.)
>
> Carl 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: how to set language explicitly in multi-lingual site

2007-07-11 Thread Amit Ramon

ׁHi,

As Malcolm pointed out, you'll have to use something like the third party 
multilingual framework for translating the database stuff.

You can find it at http://code.google.com/p/django-multilingual/

Good luck,

Amit

ביום רביעי 11 יולי 2007, 12:06, נכתב על ידי Matt Davies:
> Hi Amit, Malcolm
> 
> We're about to build a site that needs english/welsh transation.
> 
> Does django.utils.translation.activate() translate from one Language to
> another without having to have both languages as text in a database?
> 
> On the fly I guess I mean.
> 
> vander.
> 

--~--~-~--~~~---~--~~
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: Problem accessing ManyToManyField

2007-07-11 Thread Shankar

On Wed, 11 Jul 2007 16:30:48 +1000, Malcolm Tredinnick wrote:

>> On Wed, 11 Jul 2007 11:27:59 +0800, Russell Keith-Magee wrote:
> [...]
>> > - What happens when you run the following: from
>> > django.contrib.auth.models import User print User.objects.all[0]
>> ::
>> output from python interpreter
>> ::
>> >>> from django.contrib.auth.models import User print
>> >>> User.objects.all[0]
>> Traceback (most recent call last):
>>   File "", line 1, in ?
>> TypeError: unsubscriptable object
> 
> To save some time here: Russell made a typo. He really wants to know the
> output of User.objects.all()[0] (the first element of the list of
> objects). Note the extra parentheses there.
> 
> Regards,
> Malcolm
-
Hi Malcolm,

Yes, that was a typo. Adding the parentheses worked.

Thanks,
Shankar


--~--~-~--~~~---~--~~
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: Update in django custom sql

2007-07-11 Thread Dannoo



I tried that and got "serialized connection: cannot commit on this
cursor"
Also tried close with no results.



On Jul 11, 11:29 am, Tim Chase <[EMAIL PROTECTED]> wrote:
> > I am wondering why does this code does not work. The sql runs fine
> > fine when executed through the postgres admin.
>
> > from django.db import connection
>
> > cursor = connection.cursor()
> > x = cursor.execute("UPDATE  videos_video SET name = 'Please work'
> > WHERE videos_video.id = 1; " )
>
> I know I've butted heads against remembering to commit the
> transaction when done.  I don't know what your current
> transaction/commit settings are, but it might not hurt to do a
> connection.commit() call in there when you're done.
>
> -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: Eclipse and PyDev setup

2007-07-11 Thread Lic. José M. Rodriguez Bacallao
Hi, I'm using Eclipse with pydev for development too. My suggestions for a
project is to create a pydev project without the src folder. later, U have
to tell eclipse in the project properties that your workspace is a source
folder and is an external source folder too.

On 7/11/07, Petra Javornicka <[EMAIL PROTECTED]> wrote:
>
>
> > I'm a django newbie, just finished the tutorial.  I would like to do my
> > development under Eclipse.  PyDev want to have a "src" folder under the
> > project, which does not really fit the django default directory
> structure.
>
> I'm a Django newbie as well and I've had a similiar/same problem.
> Originally,
> I decided to force Pydev use  =  folder
> i.e. with remapped src folder.
>
> But I encountered problems with setting of python and/or src path: if
> it was OK for Apache and mod_python, it was not OK for Pydev and vice
> versa and dtto form development server.
>
> Finally I changed Pydev to its defaults i.e.
>
> //src//
>
> And everything works fine now. But as I wrote: I'm a beginner and
> maybe it is possible to configure all three systems this way - perhaps
> some skilled Django users/developers will enlighten this.
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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: Update in django custom sql

2007-07-11 Thread Tim Chase

> I am wondering why does this code does not work. The sql runs fine
> fine when executed through the postgres admin.
> 
> from django.db import connection
> 
> cursor = connection.cursor()
> x = cursor.execute("UPDATE  videos_video SET name = 'Please work'
> WHERE videos_video.id = 1; " )


I know I've butted heads against remembering to commit the 
transaction when done.  I don't know what your current 
transaction/commit settings are, but it might not hurt to do a 
connection.commit() call in there when you're done.

-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: MySQL Got packet bigger than 'max_allowed_packet'

2007-07-11 Thread [EMAIL PROTECTED]

Hi

fixed the problem mysql for python 1.2.2 did the trick
http://sourceforge.net/project/showfiles.php?group_id=22307_id=15775

Thanks again
Owen

On Jul 8, 9:33 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hello
>
> I wrote a test case using mysldb with direct python calls and using
> the django model classes to insert various sized binary data into a
> blob field. First I changed the value of max_allowed_packets in my.cnf
> to prove/disprove that mysqldb/django are using it.  Conclusion they
> do use my.cnf and setting it to 1k will always cause the error. So I
> set it to 32M and tried loading the large data.
> Both the mysqldb direct call and django model class routes fail at
> some point between 10M and 25M with the max packet error. Seems like a
> bug in mysqldb as the same mysql insert works up to 30M. I'm going to
> see if there is a later version to try.
>
> Thanks for the help
>
> Owen
>
> On Jul 4, 4:27 pm, Carl Karsten <[EMAIL PROTECTED]> wrote:
>
> > [EMAIL PROTECTED] wrote:
> > > Thanks Martn and Carl.
>
> > > I would really like to avoid having to re design the architecture of
> > > the application at this stage (its a case of the requirements changing
> > > after roll out), althougth thanks for the comments re serving large
> > > data volumes.
> > > I have made the adjustments suggested 
> > > inhttp://dev.mysql.com/doc/refman/4.1/en/packet-too-large.html
> > > prior to making these loading the insert directly into  mysql failed,
> > > afterwards it suceeded but the insert through django still fails hence
> > > my question - Does django ignore the max_allowed_packet setting in
> > > my.cnf?
> > > if so how can it be increased so that django uses it?
>
> > django uses python's mysqldb module, which uses mysql's client library.
>
> > My guess is the my.conf you edited is not the one being used.
>
> > I would write a little 5 line .py that just connects and inserts a 5m wad of
> > data.  my guess is it will fail.
>
> > I tried to track down exactly where the .conf file got read, and ran out of
> > time.  But I did see that you can specify it as part of the connection:
>
> > 89 read_default_file
> > 90   file from which default client values are read
>
> >http://mysql-python.svn.sourceforge.net/viewvc/mysql-python/trunk/MyS...
>
> > I rushed this post and just psoted what I had so far, so let me know if you 
> > need
> > more details.
>
> > Carl 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
-~--~~~~--~~--~--~---



Update in django custom sql

2007-07-11 Thread Dannoo

I am wondering why does this code does not work. The sql runs fine
fine when executed through the postgres admin.

from django.db import connection

cursor = connection.cursor()
x = cursor.execute("UPDATE  videos_video SET name = 'Please work'
WHERE videos_video.id = 1; " )


Any help thoughts would be appreciated.

Thanks,
Dan


--~--~-~--~~~---~--~~
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: Eclipse and PyDev setup

2007-07-11 Thread Rogelio

Hi,

I'm a newbie as well, but have a project I developed using
Eclipse and Pydev.  Bascially, I just unchecked the "Create
src folder" option for the Pydev project and all seems OK so far.
Can't help with Apache yet as I just use the Django builtin server
from within Eclipse and start/stop the server there.

Rog

On Jul 11, 10:40 am, "Sells, Fred" <[EMAIL PROTECTED]> wrote:
> I'm using Eclipse 3.2 and latest PyDev.
>
> I'm a django newbie, just finished the tutorial.  I would like to do my
> development under Eclipse.  PyDev want to have a "src" folder under the
> project, which does not really fit the django default directory structure.
>
> mysite (an Elcipse project)
> polls
> templates
> settings.py
> ...
>
> I'm not sure of the cleanest way to get the functionality of the "src"
> folder:
> 1. Is there a way to define the project folder as being the "src" folder?
> 2. Should I create a "dummy" project and then have all the django stuff
> under it's src folder
> 3. ???
>
> For development purposes, I would like to have Apache point to the django
> project root (mydjangodemo above).  So changes are immediately available,
> eliminating a "deploy" cycle.
>
> Any suggestions?
>
> ---
> The information contained in this message may be privileged and / or
> confidential and protected from disclosure. If the reader of this message is
> not the intended recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited. If you
> have received this communication in error, please notify the sender
> immediately by replying to this message and deleting the material from any
> computer.
> ---


--~--~-~--~~~---~--~~
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: Eclipse and PyDev setup

2007-07-11 Thread Petra Javornicka

> I'm a django newbie, just finished the tutorial.  I would like to do my
> development under Eclipse.  PyDev want to have a "src" folder under the
> project, which does not really fit the django default directory structure.

I'm a Django newbie as well and I've had a similiar/same problem. Originally,
I decided to force Pydev use  =  folder
i.e. with remapped src folder.

But I encountered problems with setting of python and/or src path: if
it was OK for Apache and mod_python, it was not OK for Pydev and vice
versa and dtto form development server.

Finally I changed Pydev to its defaults i.e.

//src//

And everything works fine now. But as I wrote: I'm a beginner and
maybe it is possible to configure all three systems this way - perhaps
some skilled Django users/developers will enlighten 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
-~--~~~~--~~--~--~---



Django live chat app?

2007-07-11 Thread [EMAIL PROTECTED]

Does anyone know of a live chat app for Django, or have any
suggestions on how to go about integrating live chat into a Django-
based site?


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



Site framework

2007-07-11 Thread Glebb

Hi, I'm trying to use the site framework, and it works, but I just
have one problem. I have a form (from form_for_model for example)
which represents an object which has a site foreign key. The site
selection shows up just fine in the form. But when I try to submit it,
it complains about the site_id being null (event though the site
variable in request.POST is correct, site id that is). Am I doing
something wrong or how I'm supposed to accomplish this? The admin site
works just fine, I can create objects there but I really need a set up
a form for my site. For now, I set the site field in models.py to
blank=True, and after submission I manually set the site field. This
is, however, not very intuitive way of doing this. Is newforms still
lacking this or is there something else I need to take in
consideration?


--~--~-~--~~~---~--~~
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: psycopg2 and django issue.. (again)

2007-07-11 Thread Etienne Robillard

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Malcom,

The steps to repeat this problem is simply to invoke 'syncdb' 
using either django-admin.py and/or manage.py, on a fresh database: 

1. export PYTHONPATH=`pwd`:/path/to/django (optional)
2. sudo dropdb -U db_user db_name 
3. sudo createdb -U db_user db_name
4. django-admin.py --settings=foo_settings syncdb 

As as a work-around, I've managed to install all the SQL tables
schemas using the sqlall hook:

1. django-admin.py --settings=foo_settings sqlall app_label > tables.sql  

Then you can install the tables manually instead of using syncdb: 

2. django-admin.py --settings=foo_settings dbshell 
some_app=>\i tables.sql  

Finally, the version number reported by the psycopg2 module is 2.0.5 (revision 
895).

Hope this helps :) 

Etienne




On Wed, 11 Jul 2007 14:00:51 +1000
Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:

> 
> On Tue, 2007-07-10 at 10:51 -0400, Etienne Robillard wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> > 
> > 
> > Hi all, 
> > 
> > I'm running into an issue using the latest psycopg2 module from svn.
> > Is there a way to have this module working with the latest django-trunk 
> > and postgresql-8.1.9 ?
> > 
> > As an alternative, is there a specific django version to use for 
> > getting syncdb up and running ?
> 
> So what is the way to repeat this problem? In this message you don't
> give any details. In the subsequent message, you've given a traceback,
> but no explanation of what needs to be done to repeat the problem.
> 
> Also what counts as "latest psycopg2 module" from your persepctive? What
> version number does it report?
> 
> Regards,
> Malcolm
> 
> -- 
> Despite the cost of living, have you noticed how popular it remains? 
> http://www.pointy-stick.com/blog/
> 
> 
> > 
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFGlDRtdXKAffkXj4MRAmG1AKCBJkimyNzgiIzoHPl4PsFhS67HsgCeOBIE
TvzL6ofsIPal1f97mc2XxaI=
=gKgR
-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
-~--~~~~--~~--~--~---



Eclipse and PyDev setup

2007-07-11 Thread Sells, Fred

I'm using Eclipse 3.2 and latest PyDev.

I'm a django newbie, just finished the tutorial.  I would like to do my
development under Eclipse.  PyDev want to have a "src" folder under the
project, which does not really fit the django default directory structure.


mysite (an Elcipse project)
polls
templates
settings.py
...

I'm not sure of the cleanest way to get the functionality of the "src"
folder:
1. Is there a way to define the project folder as being the "src" folder?
2. Should I create a "dummy" project and then have all the django stuff
under it's src folder
3. ???

For development purposes, I would like to have Apache point to the django
project root (mydjangodemo above).  So changes are immediately available,
eliminating a "deploy" cycle.

Any suggestions?

---
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---

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



أرجو منكم مساعدتي لتحسين ألكمبيوتر ألخاص بي لأنني موظف متقاعد ومبتدي في ألأنترنيت

2007-07-11 Thread abumajed
أنا كنت سابقا موظفا وألآن متقاعد فوجدت إن ألوسيله أللتي أقضي بها فراغي
هي ألأنترنيت طبعا بعد نصائح من أصدقاء إضافةإلى ذلك إنني رجل أعزب
وألمشكله ألكبيره أللتي أواجهها هي ضعف لغتي ألإنجليزيه وطبعا استعمالي
في المنزل ولا يكون بجواري من يساعدني على ترجمة اللغه ألإنجليزيه
فأستعمن ببرنامج ألترجمه ولكنه بطىء ولكن أحسن من لاشىء ، فطلبي أن
تساعدوني في تحسين ألكمبيوتر ألخاص بي ولكم جزيل ألشكر لما تقدموه من
خدمه كبيره لنا في منازلنا وخاصة كأمثالي من ألمبتدئين وهم عددكبير اتجه
الى استعمال ألأنترنيت لقضاء وقت ألفراغ ألطويل ، وألمشكله ألأخرى انه
حينما أطلب برنامج حسب توجيهات برنامج الترجمه وابحث عن البرنامج اجده
بعد عناء طويل ولكن مقابل سعر معين فأصرف النظر عنه لأنني خسرت جهاز
كمبيوتر كامل كلفني الكثير وذلك في بداية استعمالي للآنترنيت ، وأيضا
اعيد الشكر لكم لمساعدتنا في منازلنا حتىنتقن هذا العلم والتكنلوجيا
ألعظيه.

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



session in all templates?

2007-07-11 Thread Martin Kaffanke
Hi there!

How can I configure django to put the session (request.session) in all
templates?

I want to put a 'Hello Username' for logged in Users, and I want to do a
dynamic login/logout button into the menu, depends on if there is a
logged in user or not.

Thanks,
Martin


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: Problem in current svn TRUNK

2007-07-11 Thread Peter Nixon

On Wed 11 Jul 2007, Michael Radziej wrote:
> Hi,
>
> you're using the alpha version of SuSE ... well ... there might very well
> be a problem very deep in one of the libraries. The alpha releases aren't
> very reliable. I'd suggest that you try it with another OS.

Hi Michael

While I agree that the the Factory version of SUSE is sometimes less stable 
than the release (or enterprise) versions, I think that you are trying to 
side step the fact that there IS a problem that has been introduced into 
django with the unicode merge. I am one of the openSUSE packagers (although 
not on the Novell payroll) and among other things I am maintaining packages 
for django-snapshot and python-markdown (Plus several hundred other 
packages) so I am not new to compatibility issues.

In any case, I listed the important packages in use on the system:
postgresql-server-8.2.4-5
python-2.5.1-12
python-psycopg2-2.0.6-2.5
python-django-snapshot-5646-1

While these are all new packages, the only one which is "unstable" is django, 
with all the others being point upgrades of existing stable releases.

It could be an incompatibility with Postgresql 8.2x but if I am the only 
person using it currently with django post the unicode branch merge, I don't 
think I will stay so for long. I run

I have tested the same django release on SUSE 10.1 (and SLES10) and the 
problem doesn't appear so its a combination of the newer packages I am 
running AND the django unicode branch as django SVN rev 5608 and earlier 
work fine on SUSE 10.3 alpha

Cheers
-- 

Peter Nixon
http://peternixon.net/

--~--~-~--~~~---~--~~
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 Book Ch3 error

2007-07-11 Thread Jeremy Dunck

On 7/11/07, Thomas Guettler <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I had the same error. Today, after "svn update" it worked.
>

Right, see this ticket:
http://code.djangoproject.com/ticket/4823

It wasn't a book error; it was a Python 2.3 incompatibility bug.

--~--~-~--~~~---~--~~
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: Problem in current svn TRUNK

2007-07-11 Thread Michael Radziej

Hi,

you're using the alpha version of SuSE ... well ... there might very well be
a problem very deep in one of the libraries. The alpha releases aren't very
reliable. I'd suggest that you try it with another OS. 

So long,

Michael


-- 
noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg -
Tel +49-911-9352-0 - Fax +49-911-9352-100
http://www.noris.de - The IT-Outsourcing Company
 
Vorstand: Ingo Kraupa (Vorsitzender), Joachim Astel, Hansjochen Klenk - 
Vorsitzender des Aufsichtsrats: Stefan Schnabel - AG Nürnberg HRB 17689

--~--~-~--~~~---~--~~
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: some problems when django worked under fastcgi..

2007-07-11 Thread KpoH

edit ./manage.py
#!/usr/bin/env python replace with #!/usr/local/bin/python

萧连衣 пишет:
>
> http://www.djangoproject.com/documentation/0.96/fastcgi/
> To easily restart your FastCGI daemon on Unix, try this small shell
> script:
> #!/bin/bash
>
> # Replace these three settings.
> PROJDIR="/home/user/myproject"
> PIDFILE="$PROJDIR/mysite.pid"
> SOCKET="$PROJDIR/mysite.sock"
>
> cd $PROJDIR
> if [ -f $PIDFILE ]; then
> kill `cat -- $PIDFILE`
> rm -f -- $PIDFILE
> fi
>
> exec /usr/bin/env - \
>   PYTHONPATH="../python:.." \
>   ./manage.py runfcgi socket=$SOCKET pidfile=$PIDFILE
>  
> I use freebsd 6.2, python 2.4.4, execute this shell and it noticed me:
> env: python: No such file or directory
> Could you tell me what's the Problem?
> How can i  solve it, ths..
>
> >

-- 
Artiom Diomin, Development Dep, "Comunicatii Libere" S.R.L.
http://www.asterisksupport.ru
http://www.asterisk-support.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: DRY violation

2007-07-11 Thread Norjee

Use the events framework. I'm sure there is a pre-save event. Use it
to execute one (DRY) method  and attach it to all your models.

I personally would just write a custom method (your custom
attach_user_to_model), which I'd call in all the save methods of the
models.. But I guess attaching evenents might make you feel more dry.
On the other hand, is writing rather obscure code really better than
adding the followin code to your models:
--
def save(self):
  attach_user_to_model(self)
---


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



DRY violation

2007-07-11 Thread Lic. José M. Rodriguez Bacallao
Hi people, I got a little problem with the DRY principle. I have a lot of
models with a common attribute: created_by, which is an attribute to store
the user who created that object but, in all my models I have to define the
save() method over and oven again to store the user manually before django
ORM save the object to database. The problem is that I love the DRY
principle and I don't want to repeat the definition of save() method, I just
don't want. Any suggestion here?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

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



DRY violation

2007-07-11 Thread Lic. José M. Rodriguez Bacallao
Hi people, I got a little problem with the DRY principle. I have a lot of
models with a common attribute: created_by, which is an attribute to store
the user who created that object but, in all my models I have to define the
save() method over and oven again to store the user manually before django
ORM save the object to database. The problem is that I love the DRY
principle and I don't want to repeat the definition of save() method, I just
don't want. Any suggestion here?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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: Calling different Django sites from the same external application

2007-07-11 Thread Robin Becker

Hancock, David (DHANCOCK) wrote:
> We have two Django "projects" with distinct settings files, and we need to
> be able to make API calls to each of them from the same (separate)
> long-running application. Using the API of one of them is easy--we've got
> the DJANGO_SETTINGS_MODULE defined in the environment of the calling
> process, and it works great. Now we're adding the second project's API
> calls, and we're getting the settings of the first project.
> 
> Has anyone got an idea for how to have two sets of settings active in the
> same application at the same time? The one proposed solution (put the second
> project inside the first one) seems a little too brute-force to me.
> 
> Cheers!

I did exactly this by having two settings files and changing the environment 
section in the apache container that we used to start off each application.


 PythonPath "['/usr/tmp/djcodeCODE']+sys.path"
 SetHandler python-program
 SetEnv DJANGO_SETTINGS_MODULE djcode.app.settings
 PythonHandler django.core.handlers.modpython
 #PythonDebug On
 PythonInterpreter app


 PythonPath "['/usr/tmp/djcodeCODE']+sys.path"
 SetHandler python-program
 SetEnv DJANGO_SETTINGS_MODULE djcode.app.test_settings
 PythonHandler django.core.handlers.modpython
 #PythonDebug On
 PythonInterpreter test_app

-- 
Robin Becker

--~--~-~--~~~---~--~~
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 a shared host. The docs are scaring me ;)

2007-07-11 Thread AndyB

Despite having three live Django sites running from Apache and FCGI I
have always felt there was a certain degree of black magic about the
process and I've succeeded only by following instructions and keeping
my fingers crossed. Quite often the process takes several hours of
fiddling and it seems fairly mysterious what exactly it is that fixes
things sometimes.

Now - I have enough basic UNIX mojo to get by with most simple web
development tasks but I am well out of my depth with some of the stuff
on this page: 
http://www.djangoproject.com/documentation/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache

Is it me or is this page over-complex? There are other pages on the
web documenting the process for example here:
http://www.djangoproject.com/documentation/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache

and here:


but some are out of date and they all contradict each other in various
ways that may or may not be significant!

Is there anyone out there with sufficient knowledge to put together a
single up to date tutorial on this? For those of us without access to
a server running mod_python (cough. Dreamhost) it would be a real boon.


--~--~-~--~~~---~--~~
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: Problem in current svn TRUNK

2007-07-11 Thread Marijn Vriens
Yesterday I saw this bug as well when working with a new project and Django
trunk. For me it went away when I changed settings.py from:
DATABASE_ENGINE = 'postgresql_psycopg2'
to
DATABASE_ENGINE = 'postgresql'

Regards,
Marijn Vriens.

On 7/11/07, Peter Nixon <[EMAIL PROTECTED]> wrote:
>
>
> Hi Paul
>
> The problem was described (as much as it is possible to) in the initial
> mail
> to the users list as well as below in the test requested by Russell.
>
> Basically django simply exists whenever it gets data based from
> postgresql..
> anywhere. syncdb, inspecdb, /admin/ and everything else that access the db
> simple die/exit with an "Aborted" message..
>
> Here is a test with SVN rev 5608 on the model listed below:
>
> testprj> python manage.py shell
> Python 2.5.1 (r251:54863, Jun 19 2007, 01:38:21)
> [GCC 4.2.1 20070604 (prerelease) (SUSE Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> from testprj.testapp.models import Test
> >>> a = Test.objects.all()
> >>> a
> []
> >>>
>
> Same test after updating to SVN rev 5609:
>
> testprj> python manage.py shell
> Python 2.5.1 (r251:54863, Jun 19 2007, 01:38:21)
> [GCC 4.2.1 20070604 (prerelease) (SUSE Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> from testprj.testapp.models import Test
> >>> a = Test.objects.all()
> >>> a
> Aborted
> testprj>
>
> Regards
>
> Peter
>
> On Wed 11 Jul 2007, Paul Bowsher wrote:
> > I may be blind, but I can't see anywhere you've actually specified what
> > the bug is. What behaviour is exhibited?
> >
> > On 7/11/07, Peter Nixon <[EMAIL PROTECTED]> wrote:
> > > Cross posted to -devel as this is definitely a bug
> > >
> > > On Wed 11 Jul 2007, Peter Nixon wrote:
> > > > On Wed 11 Jul 2007, Russell Keith-Magee wrote:
> > > > > On 7/10/07, Peter Nixon <[EMAIL PROTECTED]> wrote:
> > > > > > How can I debug this in a way that will provide the developers
> > > > > > with more usefull info?
> > > > >
> > > > > The best way to help us debug this would be to produce a minimal
> > > > > example that replicates the problem - that is, a standalone
> example
> > > > > that is as small as you can make it while still generating the
> > > > > problem.
> > > > >
> > > > > django-admin.py startproject testprj
> > > > > cd testprj/
> > > >
> > > > testprj> python manage.py startapp testapp
> > > > testprj> vi settings.py
> > > > testprj> cat settings.py
> > > > # Django settings for testprj project.
> > > >
> > > > DEBUG = True
> > > > TEMPLATE_DEBUG = DEBUG
> > > >
> > > > ADMINS = (
> > > > # ('Your Name', '[EMAIL PROTECTED]'),
> > > > )
> > > >
> > > > MANAGERS = ADMINS
> > > >
> > > > DATABASE_ENGINE = 'postgresql_psycopg2'
> > > > # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or
> 'oracle'.
> > > > DATABASE_NAME = 'djangotest' # Or path to database file
> if
> > > > using sqlite3.
> > > > DATABASE_USER = 'djangotest' # Not used with sqlite3.
> > > > DATABASE_PASSWORD = 'djangotest' # Not used with sqlite3.
> > > > DATABASE_HOST = '127.0.0.1' # Set to empty string for
> > > > localhost. Not used with sqlite3.
> > > > DATABASE_PORT = '' # Set to empty string for default.
> Not
> > >
> > > used
> > >
> > > > with sqlite3.
> > > >
> > > > # Local time zone for this installation. Choices can be found here:
> > > > #
> > >
> > >
> http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIM
> > >E-
> > >
> > > >TIMEZONE-SET-TABLE # although not all variations may be possible on
> all
> > > > operating systems. # If running in a Windows environment this must
> be
> > >
> > > set
> > >
> > > > to the same as your # system time zone.
> > > > TIME_ZONE = 'America/Chicago'
> > > >
> > > > # Language code for this installation. All choices can be found
> here:
> > > > # http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
> > > > # http://blogs.law.harvard.edu/tech/stories/storyReader$15
> > > > LANGUAGE_CODE = 'en-us'
> > > >
> > > > SITE_ID = 1
> > > >
> > > > # If you set this to False, Django will make some optimizations so
> as
> > >
> > > not
> > >
> > > > # to load the internationalization machinery.
> > > > USE_I18N = True
> > > >
> > > > # Absolute path to the directory that holds media.
> > > > # Example: "/home/media/media.lawrence.com/"
> > > > MEDIA_ROOT = ''
> > > >
> > > > # URL that handles the media served from MEDIA_ROOT. Make sure to
> use
> > > > a # trailing slash if there is a path component (optional in other
> > > > cases). # Examples: "http://media.lawrence.com;,
> > > > "http://example.com/media/; MEDIA_URL = ''
> > > >
> > > > # URL prefix for admin media -- CSS, JavaScript and images. Make
> sure
> > > > to use a
> > > > # trailing slash.
> > > > # Examples: "http://foo.com/media/;, "/media/".
> > > > ADMIN_MEDIA_PREFIX = '/media/'
> > > >
> > > > # Make this unique, and don't share it 

Re: Problem in current svn TRUNK

2007-07-11 Thread Peter Nixon

Hi Paul

The problem was described (as much as it is possible to) in the initial mail 
to the users list as well as below in the test requested by Russell.

Basically django simply exists whenever it gets data based from postgresql.. 
anywhere. syncdb, inspecdb, /admin/ and everything else that access the db 
simple die/exit with an "Aborted" message..

Here is a test with SVN rev 5608 on the model listed below:

testprj> python manage.py shell
Python 2.5.1 (r251:54863, Jun 19 2007, 01:38:21)
[GCC 4.2.1 20070604 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from testprj.testapp.models import Test
>>> a = Test.objects.all()
>>> a
[]
>>>

Same test after updating to SVN rev 5609:

testprj> python manage.py shell
Python 2.5.1 (r251:54863, Jun 19 2007, 01:38:21)
[GCC 4.2.1 20070604 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from testprj.testapp.models import Test
>>> a = Test.objects.all()
>>> a
Aborted
testprj>

Regards

Peter

On Wed 11 Jul 2007, Paul Bowsher wrote:
> I may be blind, but I can't see anywhere you've actually specified what
> the bug is. What behaviour is exhibited?
>
> On 7/11/07, Peter Nixon <[EMAIL PROTECTED]> wrote:
> > Cross posted to -devel as this is definitely a bug
> >
> > On Wed 11 Jul 2007, Peter Nixon wrote:
> > > On Wed 11 Jul 2007, Russell Keith-Magee wrote:
> > > > On 7/10/07, Peter Nixon <[EMAIL PROTECTED]> wrote:
> > > > > How can I debug this in a way that will provide the developers
> > > > > with more usefull info?
> > > >
> > > > The best way to help us debug this would be to produce a minimal
> > > > example that replicates the problem - that is, a standalone example
> > > > that is as small as you can make it while still generating the
> > > > problem.
> > > >
> > > > django-admin.py startproject testprj
> > > > cd testprj/
> > >
> > > testprj> python manage.py startapp testapp
> > > testprj> vi settings.py
> > > testprj> cat settings.py
> > > # Django settings for testprj project.
> > >
> > > DEBUG = True
> > > TEMPLATE_DEBUG = DEBUG
> > >
> > > ADMINS = (
> > > # ('Your Name', '[EMAIL PROTECTED]'),
> > > )
> > >
> > > MANAGERS = ADMINS
> > >
> > > DATABASE_ENGINE = 'postgresql_psycopg2'
> > > # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> > > DATABASE_NAME = 'djangotest' # Or path to database file if
> > > using sqlite3.
> > > DATABASE_USER = 'djangotest' # Not used with sqlite3.
> > > DATABASE_PASSWORD = 'djangotest' # Not used with sqlite3.
> > > DATABASE_HOST = '127.0.0.1' # Set to empty string for
> > > localhost. Not used with sqlite3.
> > > DATABASE_PORT = '' # Set to empty string for default. Not
> >
> > used
> >
> > > with sqlite3.
> > >
> > > # Local time zone for this installation. Choices can be found here:
> > > #
> >
> > http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIM
> >E-
> >
> > >TIMEZONE-SET-TABLE # although not all variations may be possible on all
> > > operating systems. # If running in a Windows environment this must be
> >
> > set
> >
> > > to the same as your # system time zone.
> > > TIME_ZONE = 'America/Chicago'
> > >
> > > # Language code for this installation. All choices can be found here:
> > > # http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
> > > # http://blogs.law.harvard.edu/tech/stories/storyReader$15
> > > LANGUAGE_CODE = 'en-us'
> > >
> > > SITE_ID = 1
> > >
> > > # If you set this to False, Django will make some optimizations so as
> >
> > not
> >
> > > # to load the internationalization machinery.
> > > USE_I18N = True
> > >
> > > # Absolute path to the directory that holds media.
> > > # Example: "/home/media/media.lawrence.com/"
> > > MEDIA_ROOT = ''
> > >
> > > # URL that handles the media served from MEDIA_ROOT. Make sure to use
> > > a # trailing slash if there is a path component (optional in other
> > > cases). # Examples: "http://media.lawrence.com;,
> > > "http://example.com/media/; MEDIA_URL = ''
> > >
> > > # URL prefix for admin media -- CSS, JavaScript and images. Make sure
> > > to use a
> > > # trailing slash.
> > > # Examples: "http://foo.com/media/;, "/media/".
> > > ADMIN_MEDIA_PREFIX = '/media/'
> > >
> > > # Make this unique, and don't share it with anybody.
> > > SECRET_KEY = '[EMAIL PROTECTED])gpbuao&[EMAIL PROTECTED]()[EMAIL 
> > > PROTECTED]'
> > >
> > > # List of callables that know how to import templates from various
> > > sources. TEMPLATE_LOADERS = (
> > > 'django.template.loaders.filesystem.load_template_source',
> > > 'django.template.loaders.app_directories.load_template_source',
> > > # 'django.template.loaders.eggs.load_template_source',
> > > )
> > >
> > > MIDDLEWARE_CLASSES = (
> > > 'django.middleware.common.CommonMiddleware',
> > > 

error: package directory '\django' does not exist

2007-07-11 Thread itajit


Hi,
 I'm trying to install Django on windows platform. As I tried to run its
 setup file it gives an error msg that "error: package directory '\django'
 does not exist" as there is directory in the folder Django-0.96. So, will
 u plz help me out from this its urgent.
 Thanx in advance for ur upcoming help reply
 Regards:
 Ajit Pandey.


-- 
View this message in context: 
http://www.nabble.com/error%3A-package-directory-%27%5Cdjango%27-does-not-exist-tf4061164.html#a11538061
Sent from the django-users mailing list archive at Nabble.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 Book Ch3 error

2007-07-11 Thread Thomas Guettler

Hi,

I had the same error. Today, after "svn update" it worked.

 Thomas

Am Dienstag, 10. Juli 2007 08:59 schrieb SM:
> Hmmm. As a last resort I replaced the SVN (0.97) version of Django
> with the 0.96 version and now it seems to work fine. Very strange, but
> I'm relieved to have 'fixed' it.
>
> On Jul 9, 11:20 pm, SM <[EMAIL PROTECTED]> wrote:
> > I hope someone can help me. I'm getting the following AttributeError
> > when I try to do the 'current_datetime' example in the Django Book,
> > chapter 3. I'm using the SVN (0.97) version of Django. It's driving me
> > crazy that I can't get such a simple thing to work!
> >
> > --- BEGIN ERROR PAGE ---
> >
> > AttributeError at /now/
> > keys
> > Request Method: GET
> > Request URL:http://mydomain.com:8080/now/
> > Exception Type: AttributeError
> > Exception Value:keys
> > Exception Location: /opt/csw/lib/python2.3/site-packages/django/core/
> > urlresolvers.py in resolve, line 234
> > Python Executable:  /opt/csw/bin/python2.3
> > Python Version: 2.3.5
> >
> > Traceback (most recent call last):
> > File "/opt/csw/lib/python2.3/site-packages/django/core/handlers/
> > base.py" in get_response
> >   68. callback, callback_args, callback_kwargs =
> > resolver.resolve(request.path)
> > File "/opt/csw/lib/python2.3/site-packages/django/core/
> > urlresolvers.py" in resolve
> >   234. sub_match_dict.update([(smart_str(k), v) for k, v in
> > sub_match[2].items()])
> >
> >   AttributeError at /now/
> >   keys

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



smtp error

2007-07-11 Thread Chris Hoeppner

Hey there!

I'm getting a quite weird smtp error when sending mail. Here's a 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 "/var/www/django/satchmo/accounts/views.py" in register
   100. send_welcome_email(email, first_name, last_name)
File "/var/www/django/satchmo/accounts/views.py" in send_welcome_email
   62. send_mail(subject, t.render(c), shop_email, [email], 
fail_silently=False)
File "/usr/lib/python2.5/site-packages/django/core/mail.py" in send_mail
   325. return EmailMessage(subject, message, from_email, 
recipient_list, connection=connection).send()
File "/usr/lib/python2.5/site-packages/django/core/mail.py" in send
   255. return self.get_connection(fail_silently).send_messages([self])
File "/usr/lib/python2.5/site-packages/django/core/mail.py" in send_messages
   163. new_conn_created = self.open()
File "/usr/lib/python2.5/site-packages/django/core/mail.py" in open
   128. self.connection = smtplib.SMTP(self.host, self.port)

   SMTPServerDisconnected at /accounts/register/
   Connection unexpectedly closed


So, first thing, I got a shell and telnet'ed the smtp server.

Here's the screenplay:

[EMAIL PROTECTED]:~# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 webdevrack.securitylan.int ESMTP Postfix (Ubuntu)
helo localhost
250 webdevrack.securitylan.int
mail from: [EMAIL PROTECTED]
250 2.1.0 Ok
rcpt to: [EMAIL PROTECTED]
250 2.1.5 Ok
abc
502 5.5.2 Error: command not recognized
data
354 End data with .
abc
abc
abc
abc
.
250 2.0.0 Ok: queued as 42E9D16403D


Seconds later, the mail was successfully delivered.

Here's an excerpt from mail.log:

Jul 11 12:58:40 webdevrack postfix/smtpd[5746]: connect from 
localhost[127.0.0.1]
Jul 11 12:59:10 webdevrack postfix/smtpd[5746]: 42E9D16403D: 
client=localhost[127.0.0.1]
Jul 11 12:59:30 webdevrack postfix/cleanup[5749]: 42E9D16403D: 
message-id=<[EMAIL PROTECTED]>
Jul 11 12:59:30 webdevrack postfix/qmgr[5714]: 42E9D16403D: 
from=<[EMAIL PROTECTED]>, size=388, nrcpt=1 (queue active)
Jul 11 12:59:32 webdevrack postfix/smtp[5752]: 42E9D16403D: 
to=<[EMAIL PROTECTED]>, relay=mail.pixware.org[64.13.227.76]:25, 
delay=29, delays=27/0.01/1.4/1, dsn=2.0.0, status=sent (250 ok 
1184151487 qp 32211)
Jul 11 12:59:32 webdevrack postfix/qmgr[5714]: 42E9D16403D: removed


Since the simmulation works fine, I don't know where the problem might 
be. I've given python the same credentials as I used on the command 
line, though localhost is on mynetworks, and thus doesn't require 
authentication.

Any clues?

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



Problem with post_syncdb signal and its processing

2007-07-11 Thread [EMAIL PROTECTED]

Hi all,

I need to create my own user groups and associated required
permissions. Honza Kral in Czech Django forum has adviced me to handle
post_syncdb signal in my Django application. It seemed to be an ideal
solution, but I recognized that I am not able to work with permissions
in my post_syncdb handler, because my handler is invoked __before__
create_permission() handler in auth application.

1. Is there any way how to run my handler __after__
create_permission() one?

2. Should not be there anoher signal - let say pre_syncdb - like ini,
save and delete events have?


Thanks for your help, Petra


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



Calling different Django sites from the same external application

2007-07-11 Thread Hancock, David (DHANCOCK)
We have two Django "projects" with distinct settings files, and we need to
be able to make API calls to each of them from the same (separate)
long-running application. Using the API of one of them is easy--we've got
the DJANGO_SETTINGS_MODULE defined in the environment of the calling
process, and it works great. Now we're adding the second project's API
calls, and we're getting the settings of the first project.

Has anyone got an idea for how to have two sets of settings active in the
same application at the same time? The one proposed solution (put the second
project inside the first one) seems a little too brute-force to me.

Cheers!
-- 
David Hancock | [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: Problem in current svn TRUNK

2007-07-11 Thread Peter Nixon

Cross posted to -devel as this is definitely a bug

On Wed 11 Jul 2007, Peter Nixon wrote:
> On Wed 11 Jul 2007, Russell Keith-Magee wrote:
> > On 7/10/07, Peter Nixon <[EMAIL PROTECTED]> wrote:
> > > How can I debug this in a way that will provide the developers with
> > > more usefull info?
> >
> > The best way to help us debug this would be to produce a minimal
> > example that replicates the problem - that is, a standalone example
> > that is as small as you can make it while still generating the
> > problem.
> >
> > django-admin.py startproject testprj
> > cd testprj/
>
> testprj> python manage.py startapp testapp
> testprj> vi settings.py
> testprj> cat settings.py
> # Django settings for testprj project.
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', '[EMAIL PROTECTED]'),
> )
>
> MANAGERS = ADMINS
>
> DATABASE_ENGINE = 'postgresql_psycopg2'
> # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> DATABASE_NAME = 'djangotest' # Or path to database file if
> using sqlite3.
> DATABASE_USER = 'djangotest' # Not used with sqlite3.
> DATABASE_PASSWORD = 'djangotest' # Not used with sqlite3.
> DATABASE_HOST = '127.0.0.1' # Set to empty string for
> localhost. Not used with sqlite3.
> DATABASE_PORT = '' # Set to empty string for default. Not used
> with sqlite3.
>
> # Local time zone for this installation. Choices can be found here:
> #
> http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-
>TIMEZONE-SET-TABLE # although not all variations may be possible on all
> operating systems. # If running in a Windows environment this must be set
> to the same as your # system time zone.
> TIME_ZONE = 'America/Chicago'
>
> # Language code for this installation. All choices can be found here:
> # http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
> # http://blogs.law.harvard.edu/tech/stories/storyReader$15
> LANGUAGE_CODE = 'en-us'
>
> SITE_ID = 1
>
> # If you set this to False, Django will make some optimizations so as not
> # to load the internationalization machinery.
> USE_I18N = True
>
> # Absolute path to the directory that holds media.
> # Example: "/home/media/media.lawrence.com/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> # trailing slash if there is a path component (optional in other cases).
> # Examples: "http://media.lawrence.com;, "http://example.com/media/;
> MEDIA_URL = ''
>
> # URL prefix for admin media -- CSS, JavaScript and images. Make sure to
> use a
> # trailing slash.
> # Examples: "http://foo.com/media/;, "/media/".
> ADMIN_MEDIA_PREFIX = '/media/'
>
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = '[EMAIL PROTECTED])gpbuao&[EMAIL PROTECTED]()[EMAIL PROTECTED]'
>
> # List of callables that know how to import templates from various
> sources. TEMPLATE_LOADERS = (
> 'django.template.loaders.filesystem.load_template_source',
> 'django.template.loaders.app_directories.load_template_source',
> # 'django.template.loaders.eggs.load_template_source',
> )
>
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.middleware.doc.XViewMiddleware',
> )
>
> ROOT_URLCONF = 'testprj.urls'
>
> TEMPLATE_DIRS = (
> # Put strings here, like "/home/html/django_templates"
> or "C:/www/django/templates".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )
>
> INSTALLED_APPS = (
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.sites',
> 'testprj.testapp',
> )
>
>
> testprj> vi testapp/models.py
> testprj> cat testapp/models.py
> from django.db import models
>
> class Test(models.Model):
> name = models.CharField(maxlength=200)
> class Admin:
> pass
>
> testprj> python manage.py syncdb  --verbosity=2
> Aborted
>
> I am using the following software versions:
> > cat /etc/SuSE-release
>
> openSUSE 10.3 (i586) Alpha5
> VERSION = 10.3
>
> > rpm -q postgresql-server
>
> postgresql-server-8.2.4-5
>
> > rpm -q python
>
> python-2.5.1-12
>
> > rpm -q python-psycopg2
>
> python-psycopg2-2.0.6-2.5
>
> > rpm -q python-django-snapshot
>
> python-django-snapshot-5646-1
>
> Please note that I am using a clean SVN check to build the django package.

OK. I have done some further testing, and gone back progressively though SVN 
versions until the problem no longer occurs. This problem first occurs in 
SVN revision 5609. (ie. 5608 works as expected and 5609 and later crashes)

The problem is therefore somewhere in the changeset at:
http://code.djangoproject.com/changeset/5609/

I hope this is enough information to fix the bug :-)

Cheers
-- 

Peter Nixon
http://www.peternixon.net/
PGP Key: 

Re: multiple inner joins in sql

2007-07-11 Thread novice

cool, the underscore seems to be the problem.

Now to the second question. What will be the best way to do this? I
mean to get the top N categories with the most offers, and from
this top categories get the top M offers that have the highest
percentage discount, that is what my not so nice SQL statement
does :-)...


On Jul 11, 3:10 am, Nathan Ostgard <[EMAIL PROTECTED]> wrote:
> On Jul 10, 2:58 pm, novice <[EMAIL PROTECTED]> wrote:
>
> > but I get error that the offers_offerprice.offerseller_id column
> > doesnt exist.
>
> I think you're missing an underscore. Your model has the field named
> offer_seller... shouldn't it then be
> offers_offerprice.offer_seller_id?


--~--~-~--~~~---~--~~
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 set language explicitly in multi-lingual site

2007-07-11 Thread Kenneth Gonsalves


On 11-Jul-07, at 2:36 PM, Matt Davies wrote:

> On the fly I guess I mean

no

-- 

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: how to set language explicitly in multi-lingual site

2007-07-11 Thread Matt Davies
Hi Amit, Malcolm

We're about to build a site that needs english/welsh transation.

Does django.utils.translation.activate() translate from one Language to
another without having to have both languages as text in a database?

On the fly I guess I mean.

vander.

On 11/07/07, Amit Ramon <[EMAIL PROTECTED]> wrote:
>
>
> Thanks, Malcolm. It works like a magic :) Just a small correction: it's
> utils,
> not util:
> django.utils.translation.activate()
>
> I think I'll now see how to I can write a middleware, so I won't have to
> call
> this in each and every view.
>
> All the best,
>
> Amit
>
> > > The problem I'm facing is how to set the django's system language when
> > > accessing a page via a url - by this I mean, for example, how to get
> string
> > > translation (e.g., using the templates "trans" thing). For example,
> when
> > > using a "/en/..." url I want to explicitly, in code, set the language
> to
> > > English, and when using a "/he/..." url I want to be able to set the
> language
> > > to Hebrew, and get strings translated.
> >
> > Look at django.util.translation.activate(). You pass it the language
> > code you want to be in effect. So just call that early enough in the
> > view processing and you should be fine. You could even write your own
> > middleware to set this automatically (base it off the LocaleMiddleware
> > if you want some hints).
> >
> > Regards,
> > Malcolm
> >
> > --
> > Works better when plugged in.
> > http://www.pointy-stick.com/blog/
> >
> >
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
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: Problem in current svn TRUNK

2007-07-11 Thread Peter Nixon

On Wed 11 Jul 2007, Russell Keith-Magee wrote:
> On 7/10/07, Peter Nixon <[EMAIL PROTECTED]> wrote:
> > How can I debug this in a way that will provide the developers with more
> > usefull info?
>
> The best way to help us debug this would be to produce a minimal
> example that replicates the problem - that is, a standalone example
> that is as small as you can make it while still generating the
> problem.

> django-admin.py startproject testprj
> cd testprj/
testprj> python manage.py startapp testapp
testprj> vi settings.py
testprj> cat settings.py
# Django settings for testprj project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', '[EMAIL PROTECTED]'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'postgresql_psycopg2'   
# 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'djangotest' # Or path to database file if using 
sqlite3.
DATABASE_USER = 'djangotest' # Not used with sqlite3.
DATABASE_PASSWORD = 'djangotest' # Not used with sqlite3.
DATABASE_HOST = '127.0.0.1' # Set to empty string for localhost. 
Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used 
with sqlite3.

# Local time zone for this installation. Choices can be found here:
# 
http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
# although not all variations may be possible on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com;, "http://example.com/media/;
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use 
a
# trailing slash.
# Examples: "http://foo.com/media/;, "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '[EMAIL PROTECTED])gpbuao&[EMAIL PROTECTED]()[EMAIL PROTECTED]'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
)

ROOT_URLCONF = 'testprj.urls'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" 
or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'testprj.testapp',
)


testprj> vi testapp/models.py
testprj> cat testapp/models.py
from django.db import models

class Test(models.Model):
name = models.CharField(maxlength=200)
class Admin:
pass

testprj> python manage.py syncdb  --verbosity=2
Aborted


I am using the following software versions:
> cat /etc/SuSE-release
openSUSE 10.3 (i586) Alpha5
VERSION = 10.3
> rpm -q postgresql-server
postgresql-server-8.2.4-5
> rpm -q python
python-2.5.1-12
> rpm -q python-psycopg2
python-psycopg2-2.0.6-2.5
> rpm -q python-django-snapshot
python-django-snapshot-5646-1

Please note that I am using a clean SVN check to build the django package. It 
does NOT include my BIGINT patch or anything else non-standard.

Regards

-- 

Peter Nixon
http://www.peternixon.net/
PGP Key: http://www.peternixon.net/public.asc

--~--~-~--~~~---~--~~
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: Graphs and django

2007-07-11 Thread Ben Ford
Hi Toby
I've grabbed a copy of your code but the RPlot.get_r_fun method isn't
working for me... Could you perhaps explain how it does the mapping to the R
function? What my testing is saying to me is that r (the one that's imported
at the top of __init__.py) has no attribute generic... I've had a very brief
look at rpy before, but I'm not exactly familiar with it's inner
workings
Great work, I've been meaning to have a crack at something like this for
ages!!
Ben

On 11/07/07, Toby Dylan Hocking <[EMAIL PROTECTED]> wrote:
>
>
> Hi there,
>
> If you still need help with making data-driven plots, why don't you check
> out my new Django package --- I'd like some testers and comments.
> Basically it is an interface to the R programming language (for statistics
> and graphics) through the RPy package. You can download my latest release:
>
> http://www.ocf.berkeley.edu/~tdhock/dataplot-0.2.tgz
>
> I'm a statistician who has been using this system for some time at my
> work, but I finally am getting around to generalizing it and packaging it
> for general use with the Django framework.
>
> The installation instructions are in INSTALL.txt in the archive.
> Documentation is mostly present in docstrings at the moment -- I'm working
> on more tutorials, but the .txt files and the example app should be enough
> to get you started.
>
> Sincerely,
> Toby Dylan Hocking
> http://www.ocf.berkeley.edu/~tdhock
>
>
> >
>


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

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



some problems when django worked under fastcgi..

2007-07-11 Thread 萧连衣
http://www.djangoproject.com/documentation/0.96/fastcgi/
To easily restart your FastCGI daemon on Unix, try this small shell script:
#!/bin/bash

# Replace these three settings.
PROJDIR="/home/user/myproject"
PIDFILE="$PROJDIR/mysite.pid"
SOCKET="$PROJDIR/mysite.sock"

cd $PROJDIR
if [ -f $PIDFILE ]; then
kill `cat -- $PIDFILE`
rm -f -- $PIDFILE
fi
exec /usr/bin/env - \
  PYTHONPATH="../python:.." \
  ./manage.py runfcgi socket=$SOCKET pidfile=$PIDFILE

I use freebsd 6.2, python 2.4.4, execute this shell and it noticed me:
env: python: No such file or directory
Could you tell me what's the Problem?
How can i  solve it, ths..

--~--~-~--~~~---~--~~
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 inner joins in sql

2007-07-11 Thread cesco

Thanks:-)

On Jul 11, 3:10 am, Nathan Ostgard <[EMAIL PROTECTED]> wrote:
> On Jul 10, 2:58 pm, novice <[EMAIL PROTECTED]> wrote:
>
> > but I get error that the offers_offerprice.offerseller_id column
> > doesnt exist.
>
> I think you're missing an underscore. Your model has the field named
> offer_seller... shouldn't it then be
> offers_offerprice.offer_seller_id?


--~--~-~--~~~---~--~~
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: Graphs and django

2007-07-11 Thread Toby Dylan Hocking

Hi there,

If you still need help with making data-driven plots, why don't you check 
out my new Django package --- I'd like some testers and comments. 
Basically it is an interface to the R programming language (for statistics 
and graphics) through the RPy package. You can download my latest release:

http://www.ocf.berkeley.edu/~tdhock/dataplot-0.2.tgz

I'm a statistician who has been using this system for some time at my 
work, but I finally am getting around to generalizing it and packaging it 
for general use with the Django framework.

The installation instructions are in INSTALL.txt in the archive. 
Documentation is mostly present in docstrings at the moment -- I'm working 
on more tutorials, but the .txt files and the example app should be enough 
to get you started.

Sincerely,
Toby Dylan Hocking
http://www.ocf.berkeley.edu/~tdhock


--~--~-~--~~~---~--~~
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: Problem accessing ManyToManyField

2007-07-11 Thread Malcolm Tredinnick

On Wed, 2007-07-11 at 06:28 +, Shankar wrote:
> On Wed, 11 Jul 2007 11:27:59 +0800, Russell Keith-Magee wrote:
[...]
> > - What happens when you run the following:
> > from django.contrib.auth.models import User print User.objects.all[0]
> ::
> output from python interpreter
> ::
> >>> from django.contrib.auth.models import User
> >>> print User.objects.all[0]
> Traceback (most recent call last):
>   File "", line 1, in ?
> TypeError: unsubscriptable object

To save some time here: Russell made a typo. He really wants to know the
output of User.objects.all()[0] (the first element of the list of
objects). Note the extra parentheses there.

Regards,
Malcolm


-- 
Honk if you love peace and quiet. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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: Problem accessing ManyToManyField

2007-07-11 Thread Shankar

Hi Russ,

Thanks very much for your input. The answers to your 'sanity checks' are 
inline.

Thanks,
Shankar

On Wed, 11 Jul 2007 11:27:59 +0800, Russell Keith-Magee wrote:

> Some quick sanity checks:
> - What version of Django are you using?
I'm using trunk 5643

> - Are you using a user profile
> somewhere, or anything else that might be affecting the rendering of
> User objects?
Not that I know of. Is there a way to check this?

> - Have you got django.contrib.auth in your INSTALLED APPS?
Yes. Please see snippet from 'settings.py' below.
::
settings.py
::
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'tagging',
'mysite.weblog',
)

> - Does the problem go away if you put 'from django.contrib.auth.models
> import User' at the top
No

> - What happens when you run the following:
> from django.contrib.auth.models import User print User.objects.all[0]
::
output from python interpreter
::
>>> from django.contrib.auth.models import User
>>> print User.objects.all[0]
Traceback (most recent call last):
  File "", line 1, in ?
TypeError: unsubscriptable object


--~--~-~--~~~---~--~~
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: Running Django and Drupal on the same PC

2007-07-11 Thread Malcolm Tredinnick

On Wed, 2007-07-11 at 06:23 +, [EMAIL PROTECTED] wrote:
> My apologies for a noob question. I have Web-Developer Server Suite
> from devsite.net running on my PC which I use to develop a website in
> Drupal. Would it be possible to install and run Django on the same
> machine and if yes, how?

What happens if you just follow the normal installation instructions for
Django? Since modern operating systems can support more than one program
at a time, the answer to your question is clearly "yes", but without
details about what is going wrong, we aren't going to be able to provide
you with specific help.

Regards,
Malcolm

-- 
Why can't you be a non-conformist like everyone else? 
http://www.pointy-stick.com/blog/


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



Running Django and Drupal on the same PC

2007-07-11 Thread [EMAIL PROTECTED]

My apologies for a noob question. I have Web-Developer Server Suite
from devsite.net running on my PC which I use to develop a website in
Drupal. Would it be possible to install and run Django on the same
machine and if yes, how?


--~--~-~--~~~---~--~~
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: possible bug in query merging using extra( where=[...])

2007-07-11 Thread Malcolm Tredinnick

On Tue, 2007-07-10 at 23:06 -0700, beda wrote:
> Hi all,
> I sometimes merge several queries together using |=. While this works
> well for "normal" queries, producing the desired "ORed" result, when I
> tried to do the same in a query using extra( where=["..."]) I got a
> wrong result - the queries were "ANDed".

I'm not sure if there's already an explicit ticket for this, but it's a
known problem and is very hard to fix in the current code. I'm rewriting
that portion of code at the moment and some of these problems will be
fixed. For now, just don't do that.

Regards,
Malcolm

-- 
On the other hand, you have different fingers. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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: data truncation: web page field input vs direct manipulation

2007-07-11 Thread Malcolm Tredinnick

On Wed, 2007-07-11 at 05:56 +, qhfgva wrote:
> Well, I upgraded to the trunk version of django and now my error looks
> like this:
> 
> UnicodeDecodeError: 'utf8' codec can't decode byte 0x94 in position 6:
> unexpected code byte
> 
> Not sure if this is much of an improvement.
[...]
> > > Here's an example with a fancy right quote char:
> >
> >  p.number = '53 5/8\x94H x 21\x94D x 47 1/4\x94L'

If you are still using this example, then it's not too surprising you
are seeing this error. Bytestrings (normal Python strings) must use
UTF-8 encoding when passed to Django. Alternatively, you can use Unicode
strings. What you can't do is pass in some arbitrarily encoded sequence
of bytes and hope Django can guess the encoding. It can't do that.

I can't even guess what byte encoding you are using in the above. I
thought it might be cp-1252, but \x94 is closing double quotes there,
not a right quote (that would be \x92). In any case, it's not UTF-8, so
you are going to have problems. Read the section on string handling in
docs/unicode.txt (or
http://www.djangoproject.com/documentation/unicode/#general-string-handling ) 
for more details.

Regards,
Malcolm


-- 
Everything is _not_ based on faith... take my word for it. 
http://www.pointy-stick.com/blog/


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



possible bug in query merging using extra( where=[...])

2007-07-11 Thread beda

Hi all,
I sometimes merge several queries together using |=. While this works
well for "normal" queries, producing the desired "ORed" result, when I
tried to do the same in a query using extra( where=["..."]) I got a
wrong result - the queries were "ANDed".
The following code demonstrates this:


>>> a = Article.objects.extra( where=["ID=7"])
>>> a[:]
[]
>>> a |= Article.objects.filter( id=8)
>>> a[:]
[]
>>> connection.queries[-1]['sql']
'SELECT
`articles_article`.`id`,`articles_article`.`title`,`articles_article`.`subtitle`,`articles_article`.`page`,`articles_article`.`page_code`,`articles_article`.`last_page`,`articles_article`.`doi`,`articles_article`.`volume`,`articles_article`.`issue`,`articles_article`.`year`,`articles_article`.`abstract`,`articles_article`.`type`,`articles_article`.`conference_id`,`articles_article`.`errata_to_id`,`articles_article`.`add_to_title`,`articles_article`.`affiliation_line`,`articles_article`.`author_line`,`articles_article`.`based_on_line`,`articles_article`.`category`,`articles_article`.`subcategory`
FROM `articles_article` WHERE ID=7 AND ((`articles_article`.`id` = 8))
ORDER BY `articles_article`.`volume` ASC, `articles_article`.`issue`
ASC, `articles_article`.`page` ASC'


Just for record, here is the desired behavior that I get using
standard filter approach for both queries.

>>> b = Article.objects.filter( id=7)
>>> b[:]
[]
>>> b |= Article.objects.filter( id=8)
>>> b[:]
[,
]
>>> connection.queries[-1]['sql']
'SELECT
`articles_article`.`id`,`articles_article`.`title`,`articles_article`.`subtitle`,`articles_article`.`page`,`articles_article`.`page_code`,`articles_article`.`last_page`,`articles_article`.`doi`,`articles_article`.`volume`,`articles_article`.`issue`,`articles_article`.`year`,`articles_article`.`abstract`,`articles_article`.`type`,`articles_article`.`conference_id`,`articles_article`.`errata_to_id`,`articles_article`.`add_to_title`,`articles_article`.`affiliation_line`,`articles_article`.`author_line`,`articles_article`.`based_on_line`,`articles_article`.`category`,`articles_article`.`subcategory`
FROM `articles_article` WHERE ((`articles_article`.`id` = 7) OR
(`articles_article`.`id` = 8)) ORDER BY `articles_article`.`volume`
ASC, `articles_article`.`issue` ASC, `articles_article`.`page` ASC'

I have been trying to find if such a bug was already reported to no
avail. I do not follow the development of Django, so it might have
already been fixed in the development version and I just didn't find
it.
Should I file a bug report?

Best regards
Beda


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