"multiple values for keyword argument" error

2007-12-03 Thread James Utter

Hi,

I've written some code which is meant to wrap around the date based
generic views. For some reason, it fails with the following error:
TypeError at /news/2007/
archive_year() got multiple values for keyword argument 'year'

Here is the contents of my wrapper function. It returns the error even
with all of the processing code commented out (as shown below). The same
code can be found at http://dpaste.com/26695/ if it doesn't display
correctly.

---
from django.views.generic import date_based

def generic_view_wrapper(request, queryset, view, extra_context={},
*args, **kwargs):
"""Wrapper around django.views.generic
Checks request to see if the user is staff, and applies appropriate
filters
depending on session variables.
"""
#queryset = queryset._clone()
#if not request.user.is_staff:
#queryset = queryset.filter(status=queryset.model.LIVE_STATUS)
#return view(request, queryset, extra_context=extra_context,
*args, **kwargs)
#else:
#qdict = {"all":   queryset,
#"drafts":
queryset.exclude(status=queryset.model.HIDDEN_STATUS),
#"live":
queryset.filter(status=queryset.model.LIVE_STATUS),}
#status = request.session.get("show", "drafts")
#extra_context["session_show"] = status
#return view(request, qdict[status],
extra_context=extra_context, *args, **kwargs)
return view(request, queryset, extra_context=extra_context, *args,
**kwargs)   # TypeError occurs here.

def archive_index(request, queryset, *args, **kwargs):
view = date_based.archive_index
return generic_view_wrapper(request, queryset, view, *args,
**kwargs)

def archive_day(request, queryset, *args, **kwargs):
view = date_based.archive_day
return generic_view_wrapper(request, queryset, view, *args,
**kwargs)

def archive_month(request, queryset, *args, **kwargs):
view = date_based.archive_month
return generic_view_wrapper(request, queryset, view, *args,
**kwargs)

def archive_year(request, queryset, *args, **kwargs):
view = date_based.archive_year
return generic_view_wrapper(request, queryset, view, *args,
**kwargs)

def object_detail(request, queryset, *args, **kwargs):
view = date_based.object_detail
return generic_view_wrapper(request, queryset, view, *args,
**kwargs)


---
Thanks, James Utter


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



Hello Guys check this out

2007-12-03 Thread ivant

I love My Job.

www.bangbangboomboom.com

http://new-best-positions-in-bed.blogspot.com

http://e-mail-scam.blogspot.com

http://this-is-good-stuff.blogspot.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Sending two list...using for loop in template

2007-12-03 Thread Greg

Hello,
I'm sending two list to my template.  I'm looping through one of my
list in a for loop.  Within that for loop I want to display that
contents of my other list.  Here is what I have so far:



Here is my return statement in my view that calls the template.

return render_to_response('webpage.htm', {'manu': s, 'thelist':
mylist})

/

Here is what I have in my template

{% for a in manu %}
{{ thelist.{{forloop.counter0}} }}
{% endfor %}

So each time I go through my loop I want to display the contents of
mylist.  So the first time through the for loop then the contents of
mylist.0 is displayed.  Then the next time through then mylist.1 is
displayed, etc...

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Having a problem using django-admin.py runserver

2007-12-03 Thread Kyle Fox

I'd just like to report that we're having this problem as well, the
same as you describe.  The `shell` command seems to work fine...
--~--~-~--~~~---~--~~
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: Another new Django site

2007-12-03 Thread Sandro

Just from a quick glance, the site design is quite pretty and
innovative. Looks like there's a ton of stuff at work there, looks
like a pretty large undertaking. Are you using satchmo for e-commerce?

On Dec 3, 2:18 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Many, many folks on this list helped me with many many things putting
> this together, and I thank all of you.
> Let me single out John M. and Tim Chase, for helping me figure out how
> to get data from a dyno run and import it into the site. Makes for
> some nifty graphs.
>
> http://classicmotorsports.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: Python Egg issues

2007-12-03 Thread Graham Dumpleton

The only obvious thing then is too make sure that all directories from
root down to the egg cache directory are actually readable/searchable
to others. If a parent directory is not readable/searchable ie., o+rx,
then Apache will not be able to search in there, even if the egg cache
directory has user/group ownership that would allow it to write to it.

Maybe for sanity check, post output of:

  ls -lasd /opt/django/eggdump/
  ls -lasd /opt/django/
  ls -lasd /opt/

Also indicate what User/Group directives in Apache configuration are
set to.

Graham

On Dec 4, 1:21 pm, Michael Newman <[EMAIL PROTECTED]> wrote:
> tried it fresh, tried it with stuff in it (for kicks). Either way
> nothing shows up, changes etc. That whole issue with mod_python might
> be the issue. For the meanwhile, so I can get to bed tonight I just
> ran easy_install. I will try without the absolute paths tomorrow.
> Thanks
>
> On Dec 3, 7:55 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
> > On Dec 4, 11:22 am, Michael Newman <[EMAIL PROTECTED]> wrote:
>
> > > This isn't strictly a problem with Django, but for some reason I am
> > > having problems extracting my python eggs. Mod_python comes back with:
>
> > > ExtractionError: Can't extract file(s) to egg cache
>
> > > The following error occurred while trying to extract file(s) to the
> > > Python egg
> > > cache:
>
> > >   [Errno 13] Permission denied: '/opt/django/eggdump/
> > > MySQL_python-1.2.2-py2.5-linux-i686.egg-tmp'
>
> > > The Python egg cache directory is currently set to:
>
> > >   /opt/django/eggdump
>
> > > Perhaps your account does not have write access to this directory?
> > > You can
> > > change the cache directory by setting the PYTHON_EGG_CACHE environment
> > > variable to point to an accessible directory.
> > > 
> > > I read these 
> > > docshttp://www.djangoproject.com/documentation/modpython/#using-eggs-with...
> > > and created the proper file and tried to put the files in my django
> > > directory. I also tried tmp and site-packages and no luck. This is a
> > > development box so I set the permissions of opt to fully executable. I
> > > also did sudo -u apache touch /opt/django/eggdump/file.txt and that
> > > worked.
>
> > > I am completely confounded, a bit tired and really annoyed. Anyone
> > > else encounter this issue before? What can I do?
>
> > FWIW, in relation to use of the PythonImport directive, Django
> > documentation says:
>
> > """Note that you can use an absolute path here (or a normal dotted
> > import path), as described in the mod_python manual. We use an
> > absolute path in the above example because if any Python path
> > modifications are required to access your project, they will not have
> > been done at the time the PythonImport line is processed."""
>
> > What the documentation doesn't say is that an absolute path can only
> > be used if you are using mod_python 3.3. If you are using an older
> > version of mod_python it will not work with an absolute path.
>
> > Anyway, did you completely remove the contents of your eggdump
> > directory before running it under mod_python, or are you allowing it
> > to try and unpack stuff on top of old stuff put there when run as a
> > different user and therefore with conflicting permissions. If you
> > ensure that eggdump directory is empty first, does it still fail?
>
> > Graham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Having a problem using django-admin.py runserver

2007-12-03 Thread Russell Keith-Magee

On Dec 4, 2007 10:29 AM, Michael <[EMAIL PROTECTED]> wrote:
>
> So I'm using a "projectless" setup where I am manually setting
> PYTHONPATH and DJANGO_SETTINGS_MODULE. For some reason my settings
> module is not being loaded correctly when I use the runserver command
> from the django-admin utility.
...
> Notice that __init__ is being used instead of the actual settings
> module.
>
> These exact steps I used above, however, _do_ work as expected when I
> revert to an older version of Django (i.e. 0.96.1). Is it that I'm
> doing something in error or has something broke in the current(at time
> of writing 0.97-pre-SVN-6869) django trunk? or... ?

Another user reported a similar problem last week [1]; the problem
appears to be in [6718]. This thread contains a workaround, but wasn't
able to completely isolate the problem (apparently it worked on Py2.5,
but not 2.4). I haven't had a chance to look at this issue yet; any
assistance you can provide in nailing down the issue will be much
appreciated.

[1] 
http://groups.google.com/group/django-users/browse_thread/thread/93128d31cf366441

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: Python Egg issues

2007-12-03 Thread Michael Newman

tried it fresh, tried it with stuff in it (for kicks). Either way
nothing shows up, changes etc. That whole issue with mod_python might
be the issue. For the meanwhile, so I can get to bed tonight I just
ran easy_install. I will try without the absolute paths tomorrow.
Thanks

On Dec 3, 7:55 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Dec 4, 11:22 am, Michael Newman <[EMAIL PROTECTED]> wrote:
>
>
>
> > This isn't strictly a problem with Django, but for some reason I am
> > having problems extracting my python eggs. Mod_python comes back with:
>
> > ExtractionError: Can't extract file(s) to egg cache
>
> > The following error occurred while trying to extract file(s) to the
> > Python egg
> > cache:
>
> >   [Errno 13] Permission denied: '/opt/django/eggdump/
> > MySQL_python-1.2.2-py2.5-linux-i686.egg-tmp'
>
> > The Python egg cache directory is currently set to:
>
> >   /opt/django/eggdump
>
> > Perhaps your account does not have write access to this directory?
> > You can
> > change the cache directory by setting the PYTHON_EGG_CACHE environment
> > variable to point to an accessible directory.
> > 
> > I read these 
> > docshttp://www.djangoproject.com/documentation/modpython/#using-eggs-with...
> > and created the proper file and tried to put the files in my django
> > directory. I also tried tmp and site-packages and no luck. This is a
> > development box so I set the permissions of opt to fully executable. I
> > also did sudo -u apache touch /opt/django/eggdump/file.txt and that
> > worked.
>
> > I am completely confounded, a bit tired and really annoyed. Anyone
> > else encounter this issue before? What can I do?
>
> FWIW, in relation to use of the PythonImport directive, Django
> documentation says:
>
> """Note that you can use an absolute path here (or a normal dotted
> import path), as described in the mod_python manual. We use an
> absolute path in the above example because if any Python path
> modifications are required to access your project, they will not have
> been done at the time the PythonImport line is processed."""
>
> What the documentation doesn't say is that an absolute path can only
> be used if you are using mod_python 3.3. If you are using an older
> version of mod_python it will not work with an absolute path.
>
> Anyway, did you completely remove the contents of your eggdump
> directory before running it under mod_python, or are you allowing it
> to try and unpack stuff on top of old stuff put there when run as a
> different user and therefore with conflicting permissions. If you
> ensure that eggdump directory is empty first, does it still fail?
>
> Graham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Having a problem using django-admin.py runserver

2007-12-03 Thread Michael

So I'm using a "projectless" setup where I am manually setting
PYTHONPATH and DJANGO_SETTINGS_MODULE. For some reason my settings
module is not being loaded correctly when I use the runserver command
from the django-admin utility.


Here's an example shell session (in Windows) using an empty project:

C:\dev>django-admin.py startproject testproject

C:\dev>set PYTHONPATH=c:\dev

C:\dev>set DJANGO_SETTINGS_MODULE=testproject.settings

C:\dev>django-admin.py runserver
Validating models...
0 errors found

Django version 0.97-pre-SVN-6869, using settings
'testproject.__init__'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.


Notice that __init__ is being used instead of the actual settings
module.

These exact steps I used above, however, _do_ work as expected when I
revert to an older version of Django (i.e. 0.96.1). Is it that I'm
doing something in error or has something broke in the current(at time
of writing 0.97-pre-SVN-6869) django trunk? or... ?

Thanks,

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: Python Egg issues

2007-12-03 Thread Graham Dumpleton

On Dec 4, 11:22 am, Michael Newman <[EMAIL PROTECTED]> wrote:
> This isn't strictly a problem with Django, but for some reason I am
> having problems extracting my python eggs. Mod_python comes back with:
>
> ExtractionError: Can't extract file(s) to egg cache
>
> The following error occurred while trying to extract file(s) to the
> Python egg
> cache:
>
>   [Errno 13] Permission denied: '/opt/django/eggdump/
> MySQL_python-1.2.2-py2.5-linux-i686.egg-tmp'
>
> The Python egg cache directory is currently set to:
>
>   /opt/django/eggdump
>
> Perhaps your account does not have write access to this directory?
> You can
> change the cache directory by setting the PYTHON_EGG_CACHE environment
> variable to point to an accessible directory.
> 
> I read these 
> docshttp://www.djangoproject.com/documentation/modpython/#using-eggs-with...
> and created the proper file and tried to put the files in my django
> directory. I also tried tmp and site-packages and no luck. This is a
> development box so I set the permissions of opt to fully executable. I
> also did sudo -u apache touch /opt/django/eggdump/file.txt and that
> worked.
>
> I am completely confounded, a bit tired and really annoyed. Anyone
> else encounter this issue before? What can I do?

FWIW, in relation to use of the PythonImport directive, Django
documentation says:

"""Note that you can use an absolute path here (or a normal dotted
import path), as described in the mod_python manual. We use an
absolute path in the above example because if any Python path
modifications are required to access your project, they will not have
been done at the time the PythonImport line is processed."""

What the documentation doesn't say is that an absolute path can only
be used if you are using mod_python 3.3. If you are using an older
version of mod_python it will not work with an absolute path.

Anyway, did you completely remove the contents of your eggdump
directory before running it under mod_python, or are you allowing it
to try and unpack stuff on top of old stuff put there when run as a
different user and therefore with conflicting permissions. If you
ensure that eggdump directory is empty first, does it still fail?

Graham
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Cannot resolve keyword 'userprofile' into field.

2007-12-03 Thread James Bennett

On 12/3/07, gkelly <[EMAIL PROTECTED]> wrote:
> I'm getting the following Traceback sporadically (using Django 0.96
> and mod_python on linux).
> I can hit refresh and the page comes up fine, but sometimes this error
> will happen again (as if some httpd children pass and some fail).

You're probably running into bug #1796 [1], which has been fixed on
Django trunk.


[1] http://code.djangoproject.com/ticket/1796


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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: dynamic fields

2007-12-03 Thread Marty Alchin

On 12/3/07, omat <[EMAIL PROTECTED]> wrote:
> In the actual case I have more fields in the Record model, and
> repeating those fields in the Review model is not DRY.

Ah, I see now. Using just "a" "b" and "c", I didn't realize they
actually mapped directly to the other model.

> If I create a model with "new" and "comment" and relate it to the
> Review, what would be the type of the field of the "new"?

You're right, that wouldn't really work for this case, now that I
understand you better.

> I want them to be, say, DateField for date fields, and an Integer
> field for integer fields, depending on the field type in the Record
> model.

Well, this is definitely possible, but whether or not it's easy
depends on a couple things.

* How many fields are we talking about?
* Is Record the only model you'll be doing this with?

Basically, it's quite possible to create the Review model dynamically,
based on fields from Record. But doing so would require a good bit of
code (probably more than just duplicating the fields), and it might
make everything less readable.

However, if you have 50 fields, or if you're doing this on a dozen
models, it might still be worth your while. Let me know what your
situation is like, and I can help you proceed.

-Gul

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



Python Egg issues

2007-12-03 Thread Michael Newman

This isn't strictly a problem with Django, but for some reason I am
having problems extracting my python eggs. Mod_python comes back with:

ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the
Python egg
cache:

  [Errno 13] Permission denied: '/opt/django/eggdump/
MySQL_python-1.2.2-py2.5-linux-i686.egg-tmp'

The Python egg cache directory is currently set to:

  /opt/django/eggdump

Perhaps your account does not have write access to this directory?
You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

I read these docs 
http://www.djangoproject.com/documentation/modpython/#using-eggs-with-mod-python
and created the proper file and tried to put the files in my django
directory. I also tried tmp and site-packages and no luck. This is a
development box so I set the permissions of opt to fully executable. I
also did sudo -u apache touch /opt/django/eggdump/file.txt and that
worked.

I am completely confounded, a bit tired and really annoyed. Anyone
else encounter this issue before? What can I do?

Thanks in advance
--~--~-~--~~~---~--~~
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: dynamic fields

2007-12-03 Thread omat

In the actual case I have more fields in the Record model, and
repeating those fields in the Review model is not DRY.

If I create a model with "new" and "comment" and relate it to the
Review, what would be the type of the field of the "new"?

I want them to be, say, DateField for date fields, and an Integer
field for integer fields, depending on the field type in the Record
model.


Thanks...



On 3 Aralık, 18:05, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> I'm a bit confused as to what you're actually trying to accomplish
> here. Will there always only be three fields (a, b and c), or will
> they actually be dynamic (and you could have many of them). If three
> is just an arbitrary number, I think you're looking at creating a new
> Model, containing "new" and "comment" and a ForeignKey back to Review.
> But I'm not sure exactly what problem you're trying to solve yet, so I
> can't say for sure if that'll help you.
>
> -Gul
>
> On Dec 3, 2007 10:16 AM, omat <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi all,
>
> > I have two models, such that, one holds a record, and the other holds
> > reviews on that record, if any.
>
> > The (simplified) models look like this:
>
> > class Record(models.Model):
> > a = models.CharField(max_length=10)
> > b = models.DateField()
> > c = models.IntegerField()
>
> > class Review(models.Model):
> > a_new = models.CharField(max_length=10)
> > a_comment = models.TextField()
> > b_new = models.DateField()
> > b_comment = models.TextField()
> > c_new = models.IntegerField()
> > c_comment = models.TextField()
> > record = models.ForeignKey(Record)
> > reviewer = modelsForeignKey(User)
>
> > As can be seen, for the fields in the Record model, I would like to
> > have one field to store a new value, and one field to hold the
> > comments on the new value. Fields that hold the new values will have
> > the original type of their counterparts in the Record model while
> > comments fields will be TextField for each original field.
>
> > And, for obvious reasons, I wish to create the part in the Review
> > model that depends on the Record model dynamically.
>
> > I went through thehttp://code.djangoproject.com/wiki/DynamicModels
> > andhttp://code.djangoproject.com/wiki/AuditTrail
>
> > Although what I wish for is much simpler than what those examples
> > cover, I had no luck managing this.
>
> > I tried looping through the _meta.fields of the Record model but I
> > couldn't manage to add them to the "base_fields"  of the Review
> > class.
>
> > Thanks for any help,
> > oMat
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Cannot resolve keyword 'userprofile' into field.

2007-12-03 Thread gkelly

Hi,

I'm getting the following Traceback sporadically (using Django 0.96
and mod_python on linux).
I can hit refresh and the page comes up fine, but sometimes this error
will happen again (as if some httpd children pass and some fail).

FYI:
def user_sites(self):
return ",".join([s.siteID for s in self.stations.all()])

and self.stations is models.ManyToManyField(Station)

Traceback (most recent call last):
File "/usr/local/lib/python2.4/site-packages/django/core/handlers/
base.py" in get_response
  77. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.4/site-packages/django/contrib/auth/
decorators.py" in _checklogin
  14. return view_func(request, *args, **kwargs)
File "/usr/local/src/acis/wxcoder/wfo_admin/views.py" in edit_user
  181. initial['sites'] = profile.user_sites() # returns csv of
siteIDs
File "/usr/local/lib/python2.4/site-packages/django/db/models/
query.py" in __iter__
  108. return iter(self._get_data())
File "/usr/local/lib/python2.4/site-packages/django/db/models/
query.py" in _get_data
  470. self._result_cache = list(self.iterator())
File "/usr/local/lib/python2.4/site-packages/django/db/models/
query.py" in iterator
  174. select, sql, params = self._get_sql_clause()
File "/usr/local/lib/python2.4/site-packages/django/db/models/
query.py" in _get_sql_clause
  484. joins2, where2, params2 = self._filters.get_sql(opts)
File "/usr/local/lib/python2.4/site-packages/django/db/models/
query.py" in get_sql
  648. joins2, where2, params2 = val.get_sql(opts)
File "/usr/local/lib/python2.4/site-packages/django/db/models/
query.py" in get_sql
  699. return parse_lookup(self.kwargs.items(), opts)
File "/usr/local/lib/python2.4/site-packages/django/db/models/
query.py" in parse_lookup
  831. joins2, where2, params2 = lookup_inner(path, lookup_type,
value, opts, opts.db_table, None)
File "/usr/local/lib/python2.4/site-packages/django/db/models/
query.py" in lookup_inner
  938. raise TypeError, "Cannot resolve keyword '%s' into field" %
name

  TypeError at /wxcoder/fo-admin/users/edit/2/
  Cannot resolve keyword 'userprofile' into 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: Installation - symlink vs. python setup.py install

2007-12-03 Thread Graham Dumpleton

Apache generally runs as a special user. This user must have read
access to those Django modules you have symlinked into the Python site-
packages directory. Thus if the files are not readable to others, or
any of the directories from the root right down to where the Django
software is actually installed are not readable/searchable to others,
then Python running under Apache will fail in being able to import the
modules.

Graham

On Dec 4, 5:25 am, Greig Rapley <[EMAIL PROTECTED]> wrote:
> Actually, I have just rerun "python setup.py install" to get my
> installation working again and noticed the running install_egg_info
> that happens last.  Might this have something to do with my problems
> when using a symlink instead ?
>
> On Dec 3, 6:17 pm, Greig Rapley <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I have django (trunk) installed on MacOSX 10.5 using mod_python and it
> > all works fine when I use python setup.py install to actually install
> > the files retrieved via subversion.  However if I follow the
> > installation instructions to use a symlink to my SITE-PACKAGES
> > directory I get the following traceback;
>
> > Traceback (most recent call last):
>
> >   File "/Library/Python/2.5/site-packages/mod_python/importer.py",
> > line 1537, in HandlerDispatch
> > default=default_handler, arg=req, silent=hlist.silent)
>
> >   File "/Library/Python/2.5/site-packages/mod_python/importer.py",
> > line 1202, in _process_target
> > module = import_module(module_name, path=path)
>
> >   File "/Library/Python/2.5/site-packages/mod_python/importer.py",
> > line 304, in import_module
> > return __import__(module_name, {}, {}, ['*'])
>
> > ImportError: No module named django.core.handlers.modpython
>
> > Now I assume this is a Python path issue but I don't know what happens
> > during "python setup.py install" that means my mod_python importer can
> > find django.core.handler.modpython when it can't find the exact same
> > file (at the exact same path) after I use a symlink ?
>
> > Any help would be greatly appreciated.
>
> > Greig
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Another new Django site

2007-12-03 Thread [EMAIL PROTECTED]

Many, many folks on this list helped me with many many things putting
this together, and I thank all of you.
Let me single out John M. and Tim Chase, for helping me figure out how
to get data from a dyno run and import it into the site. Makes for
some nifty graphs.

http://classicmotorsports.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
-~--~~~~--~~--~--~---



Thanks for the blogs

2007-12-03 Thread Michael

Just a quick thanks to those who posted so many Django blogs
throughout November.  In particular, Marty's (http://
gulopine.gamemusic.org/) postings on descriptors and James' (http://
www.b-list.org/weblog/categories/django/) series on NewForms were very
helpful, though I saw many things I'll be going back to and looking at
later.  Thanks.
 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: Installation - symlink vs. python setup.py install

2007-12-03 Thread Greig Rapley

Actually, I have just rerun "python setup.py install" to get my
installation working again and noticed the running install_egg_info
that happens last.  Might this have something to do with my problems
when using a symlink instead ?


On Dec 3, 6:17 pm, Greig Rapley <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have django (trunk) installed on MacOSX 10.5 using mod_python and it
> all works fine when I use python setup.py install to actually install
> the files retrieved via subversion.  However if I follow the
> installation instructions to use a symlink to my SITE-PACKAGES
> directory I get the following traceback;
>
> Traceback (most recent call last):
>
>   File "/Library/Python/2.5/site-packages/mod_python/importer.py",
> line 1537, in HandlerDispatch
> default=default_handler, arg=req, silent=hlist.silent)
>
>   File "/Library/Python/2.5/site-packages/mod_python/importer.py",
> line 1202, in _process_target
> module = import_module(module_name, path=path)
>
>   File "/Library/Python/2.5/site-packages/mod_python/importer.py",
> line 304, in import_module
> return __import__(module_name, {}, {}, ['*'])
>
> ImportError: No module named django.core.handlers.modpython
>
> Now I assume this is a Python path issue but I don't know what happens
> during "python setup.py install" that means my mod_python importer can
> find django.core.handler.modpython when it can't find the exact same
> file (at the exact same path) after I use a symlink ?
>
> Any help would be greatly appreciated.
>
> Greig
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Installation - symlink vs. python setup.py install

2007-12-03 Thread Greig Rapley

Hi,

I have django (trunk) installed on MacOSX 10.5 using mod_python and it
all works fine when I use python setup.py install to actually install
the files retrieved via subversion.  However if I follow the
installation instructions to use a symlink to my SITE-PACKAGES
directory I get the following traceback;

Traceback (most recent call last):

  File "/Library/Python/2.5/site-packages/mod_python/importer.py",
line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)

  File "/Library/Python/2.5/site-packages/mod_python/importer.py",
line 1202, in _process_target
module = import_module(module_name, path=path)

  File "/Library/Python/2.5/site-packages/mod_python/importer.py",
line 304, in import_module
return __import__(module_name, {}, {}, ['*'])

ImportError: No module named django.core.handlers.modpython


Now I assume this is a Python path issue but I don't know what happens
during "python setup.py install" that means my mod_python importer can
find django.core.handler.modpython when it can't find the exact same
file (at the exact same path) after I use a symlink ?

Any help would be greatly appreciated.

Greig



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Using raw SQL with filter-support (or: speeding up MySQL views)

2007-12-03 Thread James Bennett

On 12/3/07, Karen Tracey <[EMAIL PROTECTED]> wrote:
> I don't know how to go from raw sql to a QuerySet.  My own custom managers
> start with a model's default QuerySet and modify it using the standard
> exclude(), etc.

There are two ways to go from raw SQL to Django model objects. One
results in a QuerySet, and is based around actually doing two queries:
first fetch the primary key values from the rows you're interested in,
then feed those to a Django API method to get a QuerySet.

The other is to select the full list of values and then pass the
resulting rows one at a time into the model's constructor, which
doesn't get you a QuerySet but does get you model objects. Under the
hood, this is how QuerySet spits back objects when you ask for them.

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: foreign key search

2007-12-03 Thread Karen Tracey
On 12/3/07, Robin Becker <[EMAIL PROTECTED]> wrote:
>
> Well I see the search box, and when I enter the id of a known A and hit
> the go
> button The page that returns has
>
> "23 results (6380 total)" beside the go button and in the body of the page
> I see
>
> 23 as
>
>
> however there's no other text in the page. I expected to see the rows that
> were
> found.
>
> After testing with different data I believe it's just one of my data rows
> that's
> vanishing.


Odd.  I've never seen anything like that, and have no idea what's going on.
Sounds like it's unrelated to the search specification, though.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Using raw SQL with filter-support (or: speeding up MySQL views)

2007-12-03 Thread Karen Tracey
On 12/3/07, Adrian R. <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
> I have a few models in my Django-App which are accessing MySQL-views.
> They return the correct result but the performance is really bad when
> I try to filter the results. I tried to speed up the view by query
> optimization but that's not good enough by half.
> When I execute the query to get all models which have a special key
> the sql-code is like "SELECT * FROM view WHERE IdColumn=foo" which
> takes approximately 5 seconds but if I move that condition into the
> sql code of the view it just takes 0.01 seconds.
> Has anyone an idea how to tell MySQL to "put that condition into the
> view query"?


Did you test out the performance using both the MERGE and TEMPTABLE
algorithms for the MySQL views?  Sometimes one can be vastly better than the
other in terms of performance and it seems MySQL doesn't always pick the
right one.  So that's one idea.  I get the impression, though, from both my
own experience in trying out views and looking around the web for help in
getting them to perform better, that the performance of MySQL views is not
the best, so switching algorithms might not help.

Because I didn't find anything helpful for that the next idea was to
> use raw sql with the same conditions like above without using a view
> and put it into a model manager. The problem is that I don't know how
> to return a QuerySet from the result or how to use the filter()-
> function with raw sql. Is it possible without rewriting/copy and
> modify half of the Django sourcecode?;)


I don't know how to go from raw sql to a QuerySet.  My own custom managers
start with a model's default QuerySet and modify it using the standard
exclude(), etc.  Can you describe your views in terms of regular Django
operations on a model's QuerySet? Note there's a lot you can do with
extra().  That's the first way I'd try to approach it, rather than trying to
turn the results of raw sql into a QuerySet.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: foreign key search

2007-12-03 Thread Robin Becker

Karen Tracey wrote:
> On 12/3/07, Robin Becker <[EMAIL PROTECTED]> wrote:
>>
>> I have a simple model with a foreign key relation
>>
>> class A(models.Model):
>>   id = models.CharField('ABCDEFG', .)
> 
> 
> Do you really have an explicit field named 'id'?  Do you also include
> primary_key=True over in that '' part?  Otherwise it seems you'd get a
> conflict between your explicitly id field and Django's auto-generated one.

id has primary_key=True


> 
> class B(models.Model):
>>   def __str__(self):
>>  return self.name
>>
>>  class Admin:
>>  list_display = ('name',)
>>  list_display_links = ('name',)
>>  ordering = ('a', 'name')
>>  search_fields = ('a__id','name')
>>
>>  a = models.ForeignKey(A, num_in_admin=3)
>>  name = models.CharField(maxlength=255, core=True )
>>
>
> 
> 
> the 'a__id' syntax is correct.  I don't quite understand what "seems to
> locate some rows, but the listing page doesn't display." means.  How can you
> tell what it found if the listing page doesn't display?  What displays
> instead of the listing page -- an error, a blank page, a
> never-finishes-loading page...?

Well I see the search box, and when I enter the id of a known A and hit the go 
button The page that returns has

"23 results (6380 total)" beside the go button and in the body of the page I see

23 as


however there's no other text in the page. I expected to see the rows that were 
found.

After testing with different data I believe it's just one of my data rows 
that's 
vanishing.


> 
> For a simple example from my own models that works for me, I have (from a
> legacy database so the names don't quite match what you'd expect for a
> Django app):
> 
...
> Karen
...

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



Re: foreign key search

2007-12-03 Thread Karen Tracey
On 12/3/07, Robin Becker <[EMAIL PROTECTED]> wrote:
>
>
> I have a simple model with a foreign key relation
>
> class A(models.Model):
>   id = models.CharField('ABCDEFG', .)


Do you really have an explicit field named 'id'?  Do you also include
primary_key=True over in that '' part?  Otherwise it seems you'd get a
conflict between your explicitly id field and Django's auto-generated one.

class B(models.Model):
>   def __str__(self):
>  return self.name
>
>  class Admin:
>  list_display = ('name',)
>  list_display_links = ('name',)
>  ordering = ('a', 'name')
>  search_fields = ('a__id','name')
>
>  a = models.ForeignKey(A, num_in_admin=3)
>  name = models.CharField(maxlength=255, core=True )
>
> originally I had the search_fields=('a','name') but that failed to search
> at
> all. My boss suggested that the documentation
> 'foreign_key__related_fieldname'
> should be replaced by 'a__id' and that seems to locate some rows, but the
> listing page doesn't display. I looked in vain for some simple examples,
> but
> cannot get this simple behaviour to work. What's the 'right' way to search
> by a
> foreign key?


the 'a__id' syntax is correct.  I don't quite understand what "seems to
locate some rows, but the listing page doesn't display." means.  How can you
tell what it found if the listing page doesn't display?  What displays
instead of the listing page -- an error, a blank page, a
never-finishes-loading page...?

For a simple example from my own models that works for me, I have (from a
legacy database so the names don't quite match what you'd expect for a
Django app):

class Authors(models.Model):
AuthorID = models.AutoField(primary_key=True, db_column='Author ID')
Author = models.CharField(unique=True, maxlength=50)
Pseudonym = models.CharField(maxlength=3, choices=YESNO_CHOICES)
Notes = models.CharField(maxlength=50,blank=True)

class Puzzles(models.Model):
PuzzleID = models.AutoField(primary_key=True, ...)
PublisherID = models.ForeignKey(Publishers, ...)
Date = models.DateField(null = True, blank = True)
AuthorID = models.ForeignKey(Authors, ...)
Title = models.CharField(maxlength=64, blank=True)
much more stuff...

with "search_fields = ['Title', 'AuthorID__Author']" for Puzzles.  That lets
me search on Title and Author's name on the Puzzle admin page.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: very slow behavior of dev server + strange errors before reaching view

2007-12-03 Thread Karen Tracey
On 12/3/07, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
>
> I'm trying to get a big project up and running again on my local
> machine. I updated to the latest trunk.
>
> I'm getting this error before reaching my view function and after
> waiting about 30 seconds while both mozilla and django just sit and do
> nothing, not even waste CPU:
>
> http://dpaste.com/26604/


Traceback seems to indicate something during the request processing is
generating a 500 exception, but attempting to render the template for the
error response is failing on lookup for "request" in the empty context used
for generating the error response page.  Do you have a 500.html template
that tries to do something with request?  But even when you get past that
error, the real problem is what is causing the server error.  Have you tried
running with debug on?

I tried removing a lot of code like the context processor, various
> pieces of middleware and change my view function to:
>
> def browse(request):
>  print "in view"
>  return HttpResponse("hello")
>
> but to no avail.
>
> Another hint is that another view function works just fine!


So what's different between the view that works and the one that
doesn't...?  That would be a better clue.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



very slow behavior of dev server + strange errors before reaching view

2007-12-03 Thread Bram - Smartelectronix

Hi,


I'm trying to get a big project up and running again on my local 
machine. I updated to the latest trunk.

I'm getting this error before reaching my view function and after 
waiting about 30 seconds while both mozilla and django just sit and do 
nothing, not even waste CPU:

http://dpaste.com/26604/

I tried removing a lot of code like the context processor, various 
pieces of middleware and change my view function to:

def browse(request):
 print "in view"
 return HttpResponse("hello")

but to no avail.

Another hint is that another view function works just fine!

Any hints would be great I'm hitting a wall here :)


cheers,


  - bram

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



foreign key search

2007-12-03 Thread Robin Becker

I have a simple model with a foreign key relation

class A(models.Model):
  id = models.CharField('ABCDEFG', .)

class B(models.Model):
  def __str__(self):
 return self.name

 class Admin:
 list_display = ('name',)
 list_display_links = ('name',)
 ordering = ('a', 'name')
 search_fields = ('a__id','name')

 a = models.ForeignKey(A, num_in_admin=3)
 name = models.CharField(maxlength=255, core=True )

originally I had the search_fields=('a','name') but that failed to search at 
all. My boss suggested that the documentation 'foreign_key__related_fieldname' 
should be replaced by 'a__id' and that seems to locate some rows, but the 
listing page doesn't display. I looked in vain for some simple examples, but 
cannot get this simple behaviour to work. What's the 'right' way to search by a 
foreign key?
-- 
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
-~--~~~~--~~--~--~---



Re: dynamic fields

2007-12-03 Thread Marty Alchin

I'm a bit confused as to what you're actually trying to accomplish
here. Will there always only be three fields (a, b and c), or will
they actually be dynamic (and you could have many of them). If three
is just an arbitrary number, I think you're looking at creating a new
Model, containing "new" and "comment" and a ForeignKey back to Review.
But I'm not sure exactly what problem you're trying to solve yet, so I
can't say for sure if that'll help you.

-Gul

On Dec 3, 2007 10:16 AM, omat <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I have two models, such that, one holds a record, and the other holds
> reviews on that record, if any.
>
> The (simplified) models look like this:
>
> class Record(models.Model):
> a = models.CharField(max_length=10)
> b = models.DateField()
> c = models.IntegerField()
>
> class Review(models.Model):
> a_new = models.CharField(max_length=10)
> a_comment = models.TextField()
> b_new = models.DateField()
> b_comment = models.TextField()
> c_new = models.IntegerField()
> c_comment = models.TextField()
> record = models.ForeignKey(Record)
> reviewer = modelsForeignKey(User)
>
>
> As can be seen, for the fields in the Record model, I would like to
> have one field to store a new value, and one field to hold the
> comments on the new value. Fields that hold the new values will have
> the original type of their counterparts in the Record model while
> comments fields will be TextField for each original field.
>
> And, for obvious reasons, I wish to create the part in the Review
> model that depends on the Record model dynamically.
>
> I went through the http://code.djangoproject.com/wiki/DynamicModels
> and http://code.djangoproject.com/wiki/AuditTrail
>
> Although what I wish for is much simpler than what those examples
> cover, I had no luck managing this.
>
> I tried looping through the _meta.fields of the Record model but I
> couldn't manage to add them to the "base_fields"  of the Review
> class.
>
> Thanks for any help,
> oMat
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Using raw SQL with filter-support (or: speeding up MySQL views)

2007-12-03 Thread Adrian R.

Hello,

I have a few models in my Django-App which are accessing MySQL-views.
They return the correct result but the performance is really bad when
I try to filter the results. I tried to speed up the view by query
optimization but that's not good enough by half.
When I execute the query to get all models which have a special key
the sql-code is like "SELECT * FROM view WHERE IdColumn=foo" which
takes approximately 5 seconds but if I move that condition into the
sql code of the view it just takes 0.01 seconds.
Has anyone an idea how to tell MySQL to "put that condition into the
view query"?

Because I didn't find anything helpful for that the next idea was to
use raw sql with the same conditions like above without using a view
and put it into a model manager. The problem is that I don't know how
to return a QuerySet from the result or how to use the filter()-
function with raw sql. Is it possible without rewriting/copy and
modify half of the Django sourcecode?;)

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



dynamic fields

2007-12-03 Thread omat

Hi all,

I have two models, such that, one holds a record, and the other holds
reviews on that record, if any.

The (simplified) models look like this:

class Record(models.Model):
a = models.CharField(max_length=10)
b = models.DateField()
c = models.IntegerField()

class Review(models.Model):
a_new = models.CharField(max_length=10)
a_comment = models.TextField()
b_new = models.DateField()
b_comment = models.TextField()
c_new = models.IntegerField()
c_comment = models.TextField()
record = models.ForeignKey(Record)
reviewer = modelsForeignKey(User)


As can be seen, for the fields in the Record model, I would like to
have one field to store a new value, and one field to hold the
comments on the new value. Fields that hold the new values will have
the original type of their counterparts in the Record model while
comments fields will be TextField for each original field.

And, for obvious reasons, I wish to create the part in the Review
model that depends on the Record model dynamically.

I went through the http://code.djangoproject.com/wiki/DynamicModels
and http://code.djangoproject.com/wiki/AuditTrail

Although what I wish for is much simpler than what those examples
cover, I had no luck managing this.

I tried looping through the _meta.fields of the Record model but I
couldn't manage to add them to the "base_fields"  of the Review
class.

Thanks for any help,
oMat


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django 1.0 plans?

2007-12-03 Thread Karen Tracey
On 12/3/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
>
> On 03-Dec-07, at 5:16 PM, Aljosa Mohorovic wrote:
>
> > if i understood correctly django book is finished, api is almost
> > stable and 1.0 release could happen soon?
> > please comment
>
> 1.0 may never come ;-) check the recent thread on the developers list


I fear that might sound a little alarming, even with the smiley, to people
who only read this list and not the other.  The thread on the developer's
list is talking about what should be in 1.0, and what 1.0 should be called.
So yes, there is recent discussion of getting "1.0" out the door.  Specific
dates haven't really come up yet, nor do I have any idea what timeframe
might be implied by "soon" in the question, so I can't guess how closely
these two unknowns might match up.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Memcached Shared Caching - What if one of the servers drops out?

2007-12-03 Thread Ned Batchelder

Memcached.py (the client library) will mark a server as dead, and then
continue to use the remaining servers.  The tuple error seems to be in
how the error is passed to mark_dead: the client code is inconsistent
about what part of the failure exception it uses.

Not pooling your cache won't help here: the client library always thinks
of the servers as a pool.  If you only have one server, you'll still be
running all the same code, and if for some reason that server becomes
unreachable, you'll likely have the same error in the client library,
plus you won't have any cache left!

--Ned.
http://nedbatchelder.com

[EMAIL PROTECTED] wrote:
> I'm not sure if this is a question about Django's implementation of
> Memcached, but I figure I'll start here...
>
> I've got three memcached servers running as a shared pool, and I my
> settings file looks like this: (web1-3 are hostnames)
>
> CACHE_BACKEND = 'memcached://web1:11211;web2:11211;web3:11211/'
>
> What happens if I lose one of the servers in my pool? Is this
> something that Django works around, or is Memcached responsible?
>
> I ask because it's happening to me right now, but I've only seen one
> error message about it. Specifically, I got the error on line 513 of
> memcache.py that the "tuple index is out of range" when it tries a
> self.mark_dead() method.
>
> It's making me rethink the idea of pooling my cache...
>
> Scott
> >
>
>   

-- 
Ned Batchelder, http://nedbatchelder.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 1.0 plans?

2007-12-03 Thread Kenneth Gonsalves


On 03-Dec-07, at 5:16 PM, Aljosa Mohorovic wrote:

> if i understood correctly django book is finished, api is almost
> stable and 1.0 release could happen soon?
> please comment

1.0 may never come ;-) check the recent thread on the developers list

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common man: http://registration.fossconf.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
-~--~~~~--~~--~--~---



django 1.0 plans?

2007-12-03 Thread Aljosa Mohorovic

if i understood correctly django book is finished, api is almost
stable and 1.0 release could happen soon?
please comment
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



ajax and newforms problems

2007-12-03 Thread super

Some trouble using ajax in with forms.
To make things simple a dumb down version
I got a two fields :

class MyForm(forms.Form):
 room =
forms.ModelChoiceField(queryset=Product.objects.filter(type=1))
 attending = forms.ChoiceField(required=False, choices=(('',
'-'),))

However each room has a max number of people. When a user selects room
A or B ... the max number of attending will be diffrent for each room.

So with jquery I adjust this part. But the newforms does not know
this. Al it cares is to validate on the offset tuple (('', '-'),)

The Question:


How can I make newforms a bit smarter.
It should give the tuple based on a range(x,z) function other
choices.
So when a post is submited then first it should look up what the max
people are for a room. This should be passed to the attending field.
Also when a form is shown for an update Newforms should first look at
how many people there are allowed in the room and change the tuple for
that.
I'm not sure how to do this in the correct way?
--~--~-~--~~~---~--~~
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: newbie questions

2007-12-03 Thread Kenneth Gonsalves


On 03-Dec-07, at 3:31 PM, Darryl Ross wrote:

>> I don't think you can do django with only ftp access
>
> Sure you can, if django is installed into the server by the hosting
> company. I'm in the process of getting a django hosting company in
> Australia going and it's not that hard to run a django site without
> shell access.

i suppose people can learn to live without manage.py - I couldn't

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common man: http://registration.fossconf.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: newbie questions

2007-12-03 Thread Darryl Ross
Kenneth Gonsalves wrote:
> 
> On 03-Dec-07, at 10:38 AM, dave's not here wrote:
>> Thanks for the quick reply. The problem is I don't currently have
>> shell access to the server, only ftp. Is there anything I can put into
>> one of the .py or template files?

Create a view that imports django and puts django.VERSION into the
context. A simple (untested) way in the urls.py by using the generic
views is:

- BEGIN -
import django
from django.conf.urls.defaults import *
urlpatterns = patterns(''
(r'^private/info/$',
  'django.views.generic.simple.direct_to_template',
  {'template': 'info.html',
   'extra_context': {'version': django.VERSION'}}),
)
-  END  -

And then you just need to create a simple info.html:

- BEGIN -


Info!


The django version is {{version}}.


-  END  -

> I don't think you can do django with only ftp access

Sure you can, if django is installed into the server by the hosting
company. I'm in the process of getting a django hosting company in
Australia going and it's not that hard to run a django site without
shell access.

Regards
Darryl




signature.asc
Description: OpenPGP digital signature


Sixth Python User Meeting in Munich

2007-12-03 Thread Marek Kubica

Hi,

just a short notice to all who live in or around Munich and are interested
in a meeting: On Thursday, 13th of December 2007 starting at 18:30 will be
a meeting of Python users from around Munich.

Of course, it is free for anyone to discuss Django as well, some of the
people attending use Django themselves.

More information (and the other, complete announcements in german) can be
found on 

See you there,
Marek


--~--~-~--~~~---~--~~
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: Expiring cache entries through model save()

2007-12-03 Thread Jarek Zgoda

Malcolm Tredinnick napisał(a):

>> I have an interesting idea that I am not quite sure how to pursue.
>> I'm wondering if any of you have figured this out already.
>>
>> What I would like to do is set the cache expiration for a particular
>> object in the cache to be very high, and then delete the item from the
>> cache when an instance of its model is saved.  This would be
>> particularly useful for a site where the data only changes through the
>> admin interface, and not very frequently.  This way, the object can
>> stay cached as long as it has not changed.
>>
>> I was thinking of trying something with the post_save signal and the
>> cache middleware.  Has anyone tried this already?  Or is this a bad
>> idea?
> 
> The usually difficult part of this type of proposal is querysets. You
> need to find every cached queryset that contains the model in question
> and delete it as well. This essentially requires scanning every queryset
> (or coming up with a really good hash function to enable cutting down
> the search set). There was a Summer of Code project that tried to do
> this, but it didn't seem to go anywhere.

I use this approach at work and in my personal site. This works great
(and greatly reduces app response times due to not hitting db every so
often), but you have to know under what key what data is cached. I came
to idea of key registry, but it works only if your app runs in one
instance only (how to share the set that implements registry between
instances?)

Signals simplify this a bit, because they give you one centralized point
of cache invalidation, but when the number of keys grows beyond some
point it's easy to get lost.

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)

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