Generating web-service API docs from urls.py

2007-11-27 Thread raminf

Say you're using Django to offer a public RESTful API (in addition to
the normal HTML output) and want to generate developer documentation
for the API part. Most Python doc-generation tools are designed to
scan for Python classes and functions. But that's not what you're
exposing to the consumers of your web-service API.

It seems like scanning urls.py and tracking down the chain of
'include' settings is what would be needed. I'm guessing there isn't
anything out there, but I figured I'd ask first in case someone had
already given it some thought.

Thanks,
-Ramin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 with other presentation solution

2007-11-27 Thread SamFeltus

I think Flash/Flex works great.   As a Web Display Technology, it's
superior to HTML/CSS in most ways except for textual information.  I
wouldn't say using Flash/Flex is painless, but it certainly is potent.

That's my 2 cents.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: IRC Channel

2007-11-27 Thread Collin Grady

Er, no, I don't own any IRC channel on freenode :)

#django still isn't registered, we need one of the devs to do that
before anyone can get op status and actually do anything
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Could I use django as a wiki replacement?

2007-11-27 Thread kevinski

If you are interested, here is a simple Wiki I threw together a few
weeks ago that allows html markup. I am still somewhat of an amateur,
so there are probably a thousand better ways to do this, but feel free
to use it as an example.

URLs

urlpatterns += patterns('project.wiki.views',
 (r'^wiki/create/$', 'create'),
 (r'^wiki/update/(?P\w+)/$', 'update'),
 (r'^wiki/$', 'wikipage', {'wikipage': "main"}),
 (r'^wiki/(?P\w+)/$', 'wikipage'),
)

Models

class Wikipage(models.Model):
title = models.SlugField(primary_key=True)
creator = models.CharField(maxlength=25, editable=False)
post_date = models.DateTimeField(auto_now_add=True)
class Admin:
list_display = ('title', 'creator', 'post_date')
def __unicode__(self):
return self.title

class Pageversion(models.Model):
page = models.ForeignKey(Wikipage, edit_inline=models.TABULAR,
num_in_admin=1)
content = models.TextField(core=True)
editor = models.CharField(maxlength=25, editable=False)
update_date = models.DateTimeField(default=datetime.datetime.now,
editable=False)


Views

def wikipage(req, wikipage):
pages=Wikipage.objects.all()
page=Wikipage.objects.get(title=wikipage)
versions=Pageversion.objects.filter(page=wikipage)
version=versions.latest('update_date')
return render_to_response('wiki/wiki_page.html', {'pages': pages,
'page': page, 'version': version})

{{page.title|title}}
{{version.content|safe}}
[ Update This Page ]
[ Create New Page ]
[ 
Go To Page
{% for page in pages %}
{{page.title|escape}}
{% endfor %}
 ]

def create(req):
pages=Wikipage.objects.all()
pages=Wikipage.objects.all()
if req.POST.has_key('title') and req.POST.has_key('content'):
p=Wikipage(title=req.POST['title'],
creator=req.POST['creator'])
p.save()
v=Pageversion(page_id=req.POST['title'],
content=req.POST['content'], editor=req.POST['creator'])
v.save()
page=req.POST['title']
address="/wiki/"+page
return HttpResponseRedirect(address)
return render_to_response('wiki/create_page.html', {'pages':
pages})

Create a New Page






def update(req, wikipage):
page=Wikipage.objects.get(title=wikipage)
versions=Pageversion.objects.filter(page=wikipage)
version=versions.latest('update_date')
if req.POST.has_key('content'):
v=Pageversion(page_id=req.POST['title'],
content=req.POST['content'], editor=req.POST['creator'])
v.save()
page=req.POST['title']
address="/wiki/"+page
return HttpResponseRedirect(address)
return render_to_response('wiki/update_page.html', {'page': page,
'version': version})

Update Page Content



{{ page.title|title }}
{{version.content}}




On Nov 27, 7:27 pm, walterbyrd <[EMAIL PROTECTED]> wrote:
> I like wikis for quickly editing and organizing documents online. I
> hate everything else about wikis - especially markup languages that
> are not compatible with anything else.
>
> Would it be difficult to develop a django app that could edit an
> online document, or a part of that document, and easily create and
> organize new docuemnts?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: user restrictions in admin interface

2007-11-27 Thread chrominance

Your best bet is to take the responsibility of data entry away from
the admin interface, and just write your own. You can hook into
generic views (which contains a basic set of create/update/delete
views for data entry) and user permissions (if you want to specify
whether users can do certain things like set the publishing status) to
make this process easier.

I can't read French so unfortunately I can't tell you if GoFlow will
work for you, but I've been able to code my own "staff" application
that sits alongside the admin interface and handles restricted data
entry based on a user's permissions. It's actually a lot nicer doing
data entry in your own application because I find the admin interface
isn't the most intuitive for non-techy users; creating my own
interface allows me to add UI niceties and workflow features that just
don't fit in the admin interface very well.

On Nov 27, 11:53 am, sam <[EMAIL PROTECTED]> wrote:
> thx for your answer
>
> ok, the problem, in my case, is that I have got 2 types of users :
> - data entry user, who write the content
> - admin user, who valid, the content
>
> what I need, finally, is a sort of workflow system, so that my
> question is now :
> ishttp://django-goflow.blogspot.com/able to do this ?
>
> sam
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 with other presentation solution

2007-11-27 Thread james_027

hi everyone fellow django users

While I am having fun with django, but not with html/css/javascript (I
am very bad at it). Any recommendation on making the presentation/view
much painless. I am thinking of something like google web toolkit but
this could mean a lot of work since the gwt is java and django is
python. Or perhaps silverlight via IronPython?

Looking forward for your suggestion

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: IRC Channel

2007-11-27 Thread Thejaswi Puthraya

On Nov 27, 3:21 pm, David Reynolds <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I've just noticed that the irc channel has lost the mode that lets
> anyone set the topic, so now only ops can do it. However, there
> doesn't seem to be any ops.  Is anyone able to fix it? I wanted to
> add something about the djangosprint to the topic.

Magus or Magus- is the owner of the IRC channel. Contact him and he'll
help you do it.

Cheers
Thejaswi Puthraya
http://thejaswi.info/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Partial Validation in newforms

2007-11-27 Thread Thejaswi Puthraya

On Nov 27, 8:32 pm, PlanarPlatypus <[EMAIL PROTECTED]>
wrote:
> Does anyone know of a clean way to do partial validation in djangos
> newforms.  I am basically after a cleaner way to do something like the
> code below.

A clarification...what do you mean by partial validation? Does it mean
that you clean each field before cleaning the form. Looks like you
have got the fundae wrong. Check out James Bennett's blog on
http://www.b-list.org/weblog/2007/nov/22/newforms/ for how newforms
work exactly.

Cheers
Thejaswi Puthraya
http://thejaswi.info/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Multi record form

2007-11-27 Thread Doug B

Django forms are just form elements, not the whole form.  The easy
approach is to split your form into several django forms, and process
them separately in the view.  If you have multiple instances of the
same form class you can keep them identified by using a prefix when
you instantiate each (you'll have to come up with your own mechanism
for generating the prefixes, you might use primary key):

http://www.djangoproject.com/documentation/newforms/#prefixes-for-forms

This is an example of prefixing (untested, and incomplete),

def make_student_forms_for(teacher,post=None):
form_list=[]
for s in teacher.student_set.all():
form_list.append(StudentForm(post,
 initial=s.__dict__.copy(),
 prefix=s._get_pk_val()))
return form_list

def student_list(request,teacher_id):
teacher = Teacher.objects.get(pk=teacher_id)
if request.POST:
errors=False
form_list = make_student_forms_for(teacher,request.POST)
for form in form_list:
if form.is_valid():
form.save() # you write this!
   else:
errors=True
   if not errors:
return HttpResponseRedirect(somewhere)
else:
form_list = make_student_forms_for(teacher)
return render_to_response('students/multiedit.html',
   {'forms':form_list,
   'teacher':teacher})

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 subclassing forms

2007-11-27 Thread Thejaswi Puthraya

> baseForm = forms.form_for_model( MyModel )
> class Form ( baseForm ):
> extra_field = forms.CharField()
>
> I'd like to have the fields defined in MyModel and add the
> extra_field, but it doesn't work.
> Besides, I'd like to have a clear example about how to use the forms
> with files (FileField or ImageField)

Read James Bennett's post on Newforms for the solution to this
problem. http://www.b-list.org/weblog/2007/nov/25/newforms/

Cheers
Thejaswi Puthraya
http://thejaswi.info/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Could I use django as a wiki replacement?

2007-11-27 Thread Thejaswi Puthraya

On Nov 28, 6:27 am, walterbyrd <[EMAIL PROTECTED]> wrote:
> I like wikis for quickly editing and organizing documents online. I
> hate everything else about wikis - especially markup languages that
> are not compatible with anything else.

Django has a contrib app called "markup" that has support for Textile,
ReSt and Markdown. Use those filters to convert markup to (X)HTML or
whatever you like.

> Would it be difficult to develop a django app that could edit an
> online document, or a part of that document, and easily create and
> organize new docuemnts?

I guess you already got the answer for this.

Cheers
Thejaswi Puthraya
http://thejaswi.info/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Pylucene

2007-11-27 Thread Thejaswi Puthraya

On Nov 28, 6:42 am, [EMAIL PROTECTED] wrote:
> Hello,
>
> It would be very helpful to know if the Django Dev. team has any plans
> to include support for
> Pylucene/ Django.contrib.search feature in the near future?

There is already a branch that has been created for addding
FullTextSearch capabilities of Lucene, Xapian and Hyper during Summer
of Code 2006. Check out 
http://code.djangoproject.com/wiki/TextIndexingAbstractionLayer
for more details.

Cheers
Thejaswi Puthraya
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Multi record form

2007-11-27 Thread Kurdy

Thanks again. I will have a look tommorow, since it's bed time now :-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Pylucene

2007-11-27 Thread vkblogger

Hello,

It would be very helpful to know if the Django Dev. team has any plans
to include support for
Pylucene/ Django.contrib.search feature in the near future?

Thanks, VK
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Could I use django as a wiki replacement?

2007-11-27 Thread Kenneth Gonsalves


On 28-Nov-07, at 6:57 AM, walterbyrd wrote:

> Would it be difficult to develop a django app that could edit an
> online document, or a part of that document, and easily create and
> organize new docuemnts?

no

-- 

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: Multi record form

2007-11-27 Thread Kenneth Gonsalves


On 28-Nov-07, at 6:41 AM, Kurdy wrote:

> Thanks for the reply, kg. But you're far too fast for me :-(
>
> Is this part of newforms implemented yet, or is it to be released?
> (I am using the latest (last oct) svn version)
>
> Do you please have any more explanation and preferably some examples?

here is something that uses two models - auth.User and a custom  
model. Since the structure of auth.User is known, it is not in the  
snippet. You will note that the first two fields come from User and  
the others come from Delegate

http://djangosnippets.org/snippets/463/

-- 

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



Could I use django as a wiki replacement?

2007-11-27 Thread walterbyrd

I like wikis for quickly editing and organizing documents online. I
hate everything else about wikis - especially markup languages that
are not compatible with anything else.

Would it be difficult to develop a django app that could edit an
online document, or a part of that document, and easily create and
organize new docuemnts?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 make such query with django ORM?

2007-11-27 Thread Scott SA

On 11/27/07, Eratothene ([EMAIL PROTECTED]) wrote:

>
>Hi django users!
>
>I have two simple models: Blog and Article.
>class Blog(models.Model):
>title = models.CharField()
>content = models.TextField()
>user = models.ForeignKey(User)
>
>class Article(models.Model):
>title = models.CharField()
>content = models.TextField()
>blog = models.ForeignKey(Blog)
>
>
>I need to get all blogs that belong to certain user and are empty (do
>not have any articles). I can't figure out how to make it with without
>extra() method.
>
>Any ideas?

I'm still pretty new at this myself but I don't see any other answers yet so I 
figure a little info is better than naught. I'm sure others will join in with 
better descriptions than mine.

Depending upon context, I think you'll need to either use the select_related() 
or _set() i.e. article.select_related() or article.blog_set() with a filter 
something like .filter(blog__content__isnull=True)

Review the db docs with the above to get a _much_ better description of how 
they work and in which context.

HTH

Scott

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Multi record form

2007-11-27 Thread Kurdy

Thanks for the reply, kg. But you're far too fast for me :-(

Is this part of newforms implemented yet, or is it to be released?
(I am using the latest (last oct) svn version)

Do you please have any more explanation and preferably some examples?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: 'Context' object has no attribute 'push'

2007-11-27 Thread eberg

To continue this monolouge I worked around the problem by omitting the
Context object and render the page with locals() instead.
This called for unsetting all "private" variables in the view.

It would however be interesting to figure out what went wrong...

cheers
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Multi record form

2007-11-27 Thread Kenneth Gonsalves


On 28-Nov-07, at 3:18 AM, Kurdy wrote:

> What I'm after is creating a multiple record form to maintain a  
> master-
> detail model/table (i used to be an oracle programmer).
> So I want to be able to show fields in a row (I'm thinking of using a
> list and css to make that possible).
> And then I want to show multiple records in that form, so I can
> maintain coherent records on one screen.
>
> Will this be possible in principle?

dead easy using newforms - all you need to do is collect the data  
from your form, split it up in the view and save it in the respective  
models.

-- 

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: Conditional Block in Template

2007-11-27 Thread Kenneth Gonsalves


On 27-Nov-07, at 7:48 PM, Manakel wrote:

> Where should i implement the mapping that should be dynamic?
> (ie when a new qualification is found, it tries to find template and
> forms based on name without manual change into the code)

include - if somecondition then include some template

-- 

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: 'Context' object has no attribute 'push'

2007-11-27 Thread eberg

Additionally a full:

Traceback (most recent call last):

 File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py",
line 81, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/var/lib/django/djangoweb/nature/apps/store/views.py", line
567, in settle
   return HttpResponse(tmp.render(c))

 File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 174, in render
   return self.nodelist.render(context)

 File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 792, in render
   bits.append(self.render_node(node, context))

 File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 805, in render_node
   return node.render(context)

 File "/usr/lib/python2.4/site-packages/django/template/
loader_tags.py", line 82, in render
   return compiled_parent.render(context)

 File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 174, in render
   return self.nodelist.render(context)

 File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 792, in render
   bits.append(self.render_node(node, context))

 File "/usr/lib/python2.4/site-packages/django/template/__init__.py",
line 805, in render_node
   return node.render(context)

 File "/usr/lib/python2.4/site-packages/django/template/
loader_tags.py", line 19, in render
   context.push()
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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
-~--~~~~--~~--~--~---



'Context' object has no attribute 'push'

2007-11-27 Thread [EMAIL PROTECTED]

Hi

This error started to show up on single page after the 2007-11-12
version of files in django/template/

Exception Value:'Context' object has no attribute 'push'
Exception Location: /usr/lib/python2.4/site-packages/django/template/
loader_tags.py in render, line 19


from debug:

Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/django/template/__init__.py" in
render_node
  810. result = node.render(context)
File "/usr/lib/python2.4/site-packages/django/template/loader_tags.py"
in render
  19. context.push()

The context.push is there allright:

File "/usr/lib/python2.4/site-packages/django/template/context.py:

class Context(object):
"A stack container for variable context"
def __init__(self, dict_=None):
dict_ = dict_ or {}
self.dicts = [dict_]

[...]

def push(self):
self.dicts = [{}] + self.dicts

[...]

Can anyone jump to conclusion?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Preferred Schema Evolution Tool

2007-11-27 Thread Mike H

SmileyChris wrote:
> On Nov 26, 1:03 pm, LorenDavie <[EMAIL PROTECTED]> wrote:
>   
>> Not sure if SmileyChris is this guy, but I've had good success with
>> this project:
>>
>> http://www.aswmc.com/dbmigration/
>> 
>
> As Mike H said, dbmigration is his project (my DBEvolution project did
> some of the "automatically generated migrations" magic using
> dbmigration as its base).
>
> If you like how dbmigration works, you'll probably like Django
> Evolution.
>   

I do!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 geneirc views to delete more than one row

2007-11-27 Thread Sawan V

Thank you for this, I had an idea that I could do this, was just
wondering if there was a "generic view" way of doing it.

Sawan

On Nov 27, 9:19 pm, "Jonathan Buchanan" <[EMAIL PROTECTED]>
wrote:
> On Nov 27, 2007 3:07 AM, Sawan V <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hello,
>
> > Is there any way to use the
> > django.views.generic.create_update.update_object  to update all the
> > rows in a table?
>
> > Example: my model contains a table with 2 columns,  role and name. For
> > a given row, role is constant and does not change but name can.
>
> > I want to write one simple page where I can present all the data in
> > the table, have the user update names as desired and then have the
> > changes applied in one go.
>
> > Any other option besides the generic view?
>
> > Thanks
>
> > Sawan
>
> The "prefix" argument for newforms makes this easy enough:
>
> Example view, which might have taken "have the changes applied in one
> go" a bit too literally:
>
> from django import newforms as forms
> from django.db import connection, transaction
> from django.shortcuts import render_to_response
> from django.template import RequestContext
>
> from yourapp.models import RoleName
>
> class UpdateNameForm(forms.Form):
> name = forms.CharField()
>
> def __init__(role_name, *args, **kwargs):
> super(UpdateNameForm, self).__init__(*args, **kwargs)
> self.fields['name'].initial = role_name.name
> self.role_name = role_name
>
> def update_names(request):
> role_names = RoleName.objects.all()
> if request.method == 'POST':
> forms = [UpdateNameForm(rn, data=request.POST, prefix='rn%s' % rn.pk) 
> \
>  for rn in role_names]
> all_valid = True
> for form in forms:
> if not form.is_valid() and all_valid:
> all_valid = False
> if all_valid:
> opts = RoleName._meta
> cursor = connection.cursor()
> cursor.executemany('UPDATE %s SET %s=%%s WHERE %s=%%s' % (
> connection.ops.quote_name(opts.db_table),
> connection.ops.quote_name(opts.get_field('name').column),
> connection.ops.quote_name(opts.pk.column)),
> [(form.cleaned_data['name'], form.role_name.pk) \
>  for form in forms])
> transaction.commit_unless_managed()
> else:
> forms = [UpdateNameForm(rn, prefix='rn%s' % rn.pk) for rn in 
> role_names]
>
> return render_to_response('yourapp/update_names.html', {
> 'forms': forms,
> }, context_instance=RequestContext(request))
>
> Example template showing the data you'll be interested in when
> building your template:
>
> {% for form in forms %}
> {{ form.role_name.role|escape }}
> {% if form.name.errors %}{{ form.name.errors.as_ul }}{% endif %}
> {{ form.name.label_tag }} {{ form.name }}
> {% endfor %}
>
> Jonathan.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Preferred Schema Evolution Tool

2007-11-27 Thread SmileyChris

On Nov 26, 1:03 pm, LorenDavie <[EMAIL PROTECTED]> wrote:
> Not sure if SmileyChris is this guy, but I've had good success with
> this project:
>
> http://www.aswmc.com/dbmigration/

As Mike H said, dbmigration is his project (my DBEvolution project did
some of the "automatically generated migrations" magic using
dbmigration as its base).

If you like how dbmigration works, you'll probably like Django
Evolution.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 subclassing forms

2007-11-27 Thread Grupo Django

Hello, it seems that when I create this code, doesn't work as
expected.

baseForm = forms.form_for_model( MyModel )
class Form ( baseForm ):
extra_field = forms.CharField()

I'd like to have the fields defined in MyModel and add the
extra_field, but it doesn't work.
Besides, I'd like to have a clear example about how to use the forms
with files (FileField or ImageField)

Thank you very much.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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
-~--~~~~--~~--~--~---



Multi record form

2007-11-27 Thread Kurdy

I'm new here (and to Django) and tried to do my searches, but don't
come any further. So this is my hope.

What I'm after is creating a multiple record form to maintain a master-
detail model/table (i used to be an oracle programmer).
So I want to be able to show fields in a row (I'm thinking of using a
list and css to make that possible).
And then I want to show multiple records in that form, so I can
maintain coherent records on one screen.

Will this be possible in principle?

I've been looking for examples for weeks now, but I'm not sure where
and how to look.

Help will be very much appriciated.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 admin

2007-11-27 Thread mike

Ok, I recreated the database, and all is well, thx for the help .

On Nov 27, 2:16 pm, mike <[EMAIL PROTECTED]> wrote:
> ok I can add issues if i add an admin class to my Issues class and add
> them from the Admin screen, but they will not save if i add them from
> the bottom of my customer form, I cant find anything in the
> documentation that addresses this
>
> On Nov 27, 1:46 pm, mike <[EMAIL PROTECTED]> wrote:
>
> > one problem, the Issues appear at the bottom of the customer form
> > along with other blank issues, , but If I add an Issue there, and save
> > it.  It erases the issue from the issue class,
>
> > On Nov 27, 1:33 pm, mike <[EMAIL PROTECTED]> wrote:
>
> > > Roman, That is EXACTLY what I needed, thx alot.
>
> > > On Nov 27, 12:45 pm, "Roman Zechner" <[EMAIL PROTECTED]> wrote:
>
> > > > 2007/11/27, mike <[EMAIL PROTECTED]>:
>
> > > > > My last post was a little confusing, I have two classes a Customer
> > > > > class and an Issue class, I would like the customer class to display
> > > > > issues where the "name" of the customer field matches the "customer"
> > > > > field of the issues class,  thus listing each customer's issues at a
> > > > > glance, any help would be appreciated.  thx in advance
>
> > > > > class Customer(models.Model):
> > > > > name = models.CharField(maxlength=100)
> > > > > service = models.IntegerField(blank=True, default=4,
> > > > > choices=SERVICE_CODES)
> > > > > comp = models.IntegerField(blank=True, default=4,
> > > > > choices=CUSTOMER_TYPES)
> > > > > email = models.CharField(blank=True, maxlength=100)
> > > > > phone_number = models.CharField(blank=True, maxlength=100)
> > > > > phone_number2 = models.CharField(blank=True, maxlength=100)
> > > > > IP_address = models.CharField(blank=True, maxlength=100)
> > > > > submitted_date = models.DateField(auto_now_add=True)
> > > > > modified_date = models.DateField(auto_now=True)
> > > > > description = models.TextField(blank=True)
> > > > > list_issues = ???
> > > > > class Admin:
> > > > > list_display = ('name', 'service', 'phone_number',
> > > > > 'submitted_date', 'modified_date')
> > > > > list_filter = ('service', 'submitted_date')
> > > > > search_fields = ('name',
> > > > > 'description','email','phone_number','IP_address')
>
> > > > > class Meta:
> > > > > ordering = ('service', 'submitted_date', 'name')
>
> > > > > def __str__(self):
> > > > > return self.name
>
> > > > > class Issue(models.Model):
> > > > > issue = models.TextField(blank=True)
> > > > > date = models.DateField()
> > > > > customer = models.ForeignKey(Customer, related_name="Customer")
>
> > > > > def __unicode__(self):
> > > > > return self.issue
>
> > > > > class Meta:
> > > > > ordering = ('issue',)
> > > > > class Admin:
> > > > > pass
>
> > > > hi mike,
>
> > > > in class Issue try to change the attribute customer according to the
> > > > following line:
> > > >   customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
> > > > related_name="Customer")
>
> > > > there's also the num_in option which determines the number of displayed
> > > > INLINE customers
>
> > > >   customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
> > > > num_in_admin=2, related_name="Customer")
>
> > > > maybe this is what you want.
>
> > > > -cheers, roman
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 admin

2007-11-27 Thread mike

ok I can add issues if i add an admin class to my Issues class and add
them from the Admin screen, but they will not save if i add them from
the bottom of my customer form, I cant find anything in the
documentation that addresses this

On Nov 27, 1:46 pm, mike <[EMAIL PROTECTED]> wrote:
> one problem, the Issues appear at the bottom of the customer form
> along with other blank issues, , but If I add an Issue there, and save
> it.  It erases the issue from the issue class,
>
> On Nov 27, 1:33 pm, mike <[EMAIL PROTECTED]> wrote:
>
> > Roman, That is EXACTLY what I needed, thx alot.
>
> > On Nov 27, 12:45 pm, "Roman Zechner" <[EMAIL PROTECTED]> wrote:
>
> > > 2007/11/27, mike <[EMAIL PROTECTED]>:
>
> > > > My last post was a little confusing, I have two classes a Customer
> > > > class and an Issue class, I would like the customer class to display
> > > > issues where the "name" of the customer field matches the "customer"
> > > > field of the issues class,  thus listing each customer's issues at a
> > > > glance, any help would be appreciated.  thx in advance
>
> > > > class Customer(models.Model):
> > > > name = models.CharField(maxlength=100)
> > > > service = models.IntegerField(blank=True, default=4,
> > > > choices=SERVICE_CODES)
> > > > comp = models.IntegerField(blank=True, default=4,
> > > > choices=CUSTOMER_TYPES)
> > > > email = models.CharField(blank=True, maxlength=100)
> > > > phone_number = models.CharField(blank=True, maxlength=100)
> > > > phone_number2 = models.CharField(blank=True, maxlength=100)
> > > > IP_address = models.CharField(blank=True, maxlength=100)
> > > > submitted_date = models.DateField(auto_now_add=True)
> > > > modified_date = models.DateField(auto_now=True)
> > > > description = models.TextField(blank=True)
> > > > list_issues = ???
> > > > class Admin:
> > > > list_display = ('name', 'service', 'phone_number',
> > > > 'submitted_date', 'modified_date')
> > > > list_filter = ('service', 'submitted_date')
> > > > search_fields = ('name',
> > > > 'description','email','phone_number','IP_address')
>
> > > > class Meta:
> > > > ordering = ('service', 'submitted_date', 'name')
>
> > > > def __str__(self):
> > > > return self.name
>
> > > > class Issue(models.Model):
> > > > issue = models.TextField(blank=True)
> > > > date = models.DateField()
> > > > customer = models.ForeignKey(Customer, related_name="Customer")
>
> > > > def __unicode__(self):
> > > > return self.issue
>
> > > > class Meta:
> > > > ordering = ('issue',)
> > > > class Admin:
> > > > pass
>
> > > hi mike,
>
> > > in class Issue try to change the attribute customer according to the
> > > following line:
> > >   customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
> > > related_name="Customer")
>
> > > there's also the num_in option which determines the number of displayed
> > > INLINE customers
>
> > >   customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
> > > num_in_admin=2, related_name="Customer")
>
> > > maybe this is what you want.
>
> > > -cheers, roman
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to make such query with django ORM?

2007-11-27 Thread Eratothene

Hi django users!

I have two simple models: Blog and Article.
class Blog(models.Model):
title = models.CharField()
content = models.TextField()
user = models.ForeignKey(User)

class Article(models.Model):
title = models.CharField()
content = models.TextField()
blog = models.ForeignKey(Blog)


I need to get all blogs that belong to certain user and are empty (do
not have any articles). I can't figure out how to make it with without
extra() method.

Any ideas?


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



Libraries of cliches and visual gimmicks for Django???

2007-11-27 Thread SamFeltus

In advance, excuse me if off topic...   :)

I was reading Vernor Vinge's Rainbows End, and was struck by the
quote...

""" Robert had a surprising amount of fun working with video effects
and network jitter.  If their project had been shown in the 1990's, it
would have been taken as a work of genius. That was the power of the
LIBRARIES of CLICHES and VISUAL GIMMICKS that lay in their tools.""" -
p 161

The internet needs a library of client and server side Python/
ActionScript, that appeals to the artistic side of the human mind,
which is neglected by modern programming languages and their
libraries.

Sam from LA

( Lower Alabamie )




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

2007-11-27 Thread mike

one problem, the Issues appear at the bottom of the customer form
along with other blank issues, , but If I add an Issue there, and save
it.  It erases the issue from the issue class,

On Nov 27, 1:33 pm, mike <[EMAIL PROTECTED]> wrote:
> Roman, That is EXACTLY what I needed, thx alot.
>
> On Nov 27, 12:45 pm, "Roman Zechner" <[EMAIL PROTECTED]> wrote:
>
> > 2007/11/27, mike <[EMAIL PROTECTED]>:
>
> > > My last post was a little confusing, I have two classes a Customer
> > > class and an Issue class, I would like the customer class to display
> > > issues where the "name" of the customer field matches the "customer"
> > > field of the issues class,  thus listing each customer's issues at a
> > > glance, any help would be appreciated.  thx in advance
>
> > > class Customer(models.Model):
> > > name = models.CharField(maxlength=100)
> > > service = models.IntegerField(blank=True, default=4,
> > > choices=SERVICE_CODES)
> > > comp = models.IntegerField(blank=True, default=4,
> > > choices=CUSTOMER_TYPES)
> > > email = models.CharField(blank=True, maxlength=100)
> > > phone_number = models.CharField(blank=True, maxlength=100)
> > > phone_number2 = models.CharField(blank=True, maxlength=100)
> > > IP_address = models.CharField(blank=True, maxlength=100)
> > > submitted_date = models.DateField(auto_now_add=True)
> > > modified_date = models.DateField(auto_now=True)
> > > description = models.TextField(blank=True)
> > > list_issues = ???
> > > class Admin:
> > > list_display = ('name', 'service', 'phone_number',
> > > 'submitted_date', 'modified_date')
> > > list_filter = ('service', 'submitted_date')
> > > search_fields = ('name',
> > > 'description','email','phone_number','IP_address')
>
> > > class Meta:
> > > ordering = ('service', 'submitted_date', 'name')
>
> > > def __str__(self):
> > > return self.name
>
> > > class Issue(models.Model):
> > > issue = models.TextField(blank=True)
> > > date = models.DateField()
> > > customer = models.ForeignKey(Customer, related_name="Customer")
>
> > > def __unicode__(self):
> > > return self.issue
>
> > > class Meta:
> > > ordering = ('issue',)
> > > class Admin:
> > > pass
>
> > hi mike,
>
> > in class Issue try to change the attribute customer according to the
> > following line:
> >   customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
> > related_name="Customer")
>
> > there's also the num_in option which determines the number of displayed
> > INLINE customers
>
> >   customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
> > num_in_admin=2, related_name="Customer")
>
> > maybe this is what you want.
>
> > -cheers, roman
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 admin

2007-11-27 Thread Roman Zechner
you're welcome :-)

here's the relating django documentation for more

http://www.djangoproject.com/documentation/tutorial02/#adding-related-objects

-roman

2007/11/27, mike <[EMAIL PROTECTED]>:
>
>
> Roman, That is EXACTLY what I needed, thx alot.
>
> On Nov 27, 12:45 pm, "Roman Zechner" <[EMAIL PROTECTED]> wrote:
> > 2007/11/27, mike <[EMAIL PROTECTED]>:
> >
> >
> >
> >
> >
> > > My last post was a little confusing, I have two classes a Customer
> > > class and an Issue class, I would like the customer class to display
> > > issues where the "name" of the customer field matches the "customer"
> > > field of the issues class,  thus listing each customer's issues at a
> > > glance, any help would be appreciated.  thx in advance
> >
> > > class Customer(models.Model):
> > > name = models.CharField(maxlength=100)
> > > service = models.IntegerField(blank=True, default=4,
> > > choices=SERVICE_CODES)
> > > comp = models.IntegerField(blank=True, default=4,
> > > choices=CUSTOMER_TYPES)
> > > email = models.CharField(blank=True, maxlength=100)
> > > phone_number = models.CharField(blank=True, maxlength=100)
> > > phone_number2 = models.CharField(blank=True, maxlength=100)
> > > IP_address = models.CharField(blank=True, maxlength=100)
> > > submitted_date = models.DateField(auto_now_add=True)
> > > modified_date = models.DateField(auto_now=True)
> > > description = models.TextField(blank=True)
> > > list_issues = ???
> > > class Admin:
> > > list_display = ('name', 'service', 'phone_number',
> > > 'submitted_date', 'modified_date')
> > > list_filter = ('service', 'submitted_date')
> > > search_fields = ('name',
> > > 'description','email','phone_number','IP_address')
> >
> > > class Meta:
> > > ordering = ('service', 'submitted_date', 'name')
> >
> > > def __str__(self):
> > > return self.name
> >
> > > class Issue(models.Model):
> > > issue = models.TextField(blank=True)
> > > date = models.DateField()
> > > customer = models.ForeignKey(Customer, related_name="Customer")
> >
> > > def __unicode__(self):
> > > return self.issue
> >
> > > class Meta:
> > > ordering = ('issue',)
> > > class Admin:
> > > pass
> >
> > hi mike,
> >
> > in class Issue try to change the attribute customer according to the
> > following line:
> >   customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
> > related_name="Customer")
> >
> > there's also the num_in option which determines the number of displayed
> > INLINE customers
> >
> >   customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
> > num_in_admin=2, related_name="Customer")
> >
> > maybe this is what you want.
> >
> > -cheers, roman
> >
>

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

2007-11-27 Thread mike

Roman, That is EXACTLY what I needed, thx alot.

On Nov 27, 12:45 pm, "Roman Zechner" <[EMAIL PROTECTED]> wrote:
> 2007/11/27, mike <[EMAIL PROTECTED]>:
>
>
>
>
>
> > My last post was a little confusing, I have two classes a Customer
> > class and an Issue class, I would like the customer class to display
> > issues where the "name" of the customer field matches the "customer"
> > field of the issues class,  thus listing each customer's issues at a
> > glance, any help would be appreciated.  thx in advance
>
> > class Customer(models.Model):
> > name = models.CharField(maxlength=100)
> > service = models.IntegerField(blank=True, default=4,
> > choices=SERVICE_CODES)
> > comp = models.IntegerField(blank=True, default=4,
> > choices=CUSTOMER_TYPES)
> > email = models.CharField(blank=True, maxlength=100)
> > phone_number = models.CharField(blank=True, maxlength=100)
> > phone_number2 = models.CharField(blank=True, maxlength=100)
> > IP_address = models.CharField(blank=True, maxlength=100)
> > submitted_date = models.DateField(auto_now_add=True)
> > modified_date = models.DateField(auto_now=True)
> > description = models.TextField(blank=True)
> > list_issues = ???
> > class Admin:
> > list_display = ('name', 'service', 'phone_number',
> > 'submitted_date', 'modified_date')
> > list_filter = ('service', 'submitted_date')
> > search_fields = ('name',
> > 'description','email','phone_number','IP_address')
>
> > class Meta:
> > ordering = ('service', 'submitted_date', 'name')
>
> > def __str__(self):
> > return self.name
>
> > class Issue(models.Model):
> > issue = models.TextField(blank=True)
> > date = models.DateField()
> > customer = models.ForeignKey(Customer, related_name="Customer")
>
> > def __unicode__(self):
> > return self.issue
>
> > class Meta:
> > ordering = ('issue',)
> > class Admin:
> > pass
>
> hi mike,
>
> in class Issue try to change the attribute customer according to the
> following line:
>   customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
> related_name="Customer")
>
> there's also the num_in option which determines the number of displayed
> INLINE customers
>
>   customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
> num_in_admin=2, related_name="Customer")
>
> maybe this is what you want.
>
> -cheers, roman
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 admin

2007-11-27 Thread Roman Zechner
2007/11/27, mike <[EMAIL PROTECTED]>:
>
>
> My last post was a little confusing, I have two classes a Customer
> class and an Issue class, I would like the customer class to display
> issues where the "name" of the customer field matches the "customer"
> field of the issues class,  thus listing each customer's issues at a
> glance, any help would be appreciated.  thx in advance
>
>
>
> class Customer(models.Model):
> name = models.CharField(maxlength=100)
> service = models.IntegerField(blank=True, default=4,
> choices=SERVICE_CODES)
> comp = models.IntegerField(blank=True, default=4,
> choices=CUSTOMER_TYPES)
> email = models.CharField(blank=True, maxlength=100)
> phone_number = models.CharField(blank=True, maxlength=100)
> phone_number2 = models.CharField(blank=True, maxlength=100)
> IP_address = models.CharField(blank=True, maxlength=100)
> submitted_date = models.DateField(auto_now_add=True)
> modified_date = models.DateField(auto_now=True)
> description = models.TextField(blank=True)
> list_issues = ???
> class Admin:
> list_display = ('name', 'service', 'phone_number',
> 'submitted_date', 'modified_date')
> list_filter = ('service', 'submitted_date')
> search_fields = ('name',
> 'description','email','phone_number','IP_address')
>
>
>
> class Meta:
> ordering = ('service', 'submitted_date', 'name')
>
> def __str__(self):
> return self.name
>
> class Issue(models.Model):
> issue = models.TextField(blank=True)
> date = models.DateField()
> customer = models.ForeignKey(Customer, related_name="Customer")
>
> def __unicode__(self):
> return self.issue
>
> class Meta:
> ordering = ('issue',)
> class Admin:
> pass
>
>
> >
>

hi mike,


in class Issue try to change the attribute customer according to the
following line:
  customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
related_name="Customer")


there's also the num_in option which determines the number of displayed
INLINE customers

  customer = models.ForeignKey(Customer, edit_inline=models.TABULAR,
num_in_admin=2, related_name="Customer")


maybe this is what you want.

-cheers, roman

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



Re: Error trying to get PostgreSQL to work...setting configuration

2007-11-27 Thread Artiom Diomin

Seems you forget to make ./manage.py syncdb

Greg пишет:
> Hello,
> I've added the following to my settings.py file:
>
> DATABASE_ENGINE = 'postgresql_psycopg2'
> DATABASE_NAME = 'postgres'
> DATABASE_USER = 'postgres'
> DATABASE_PASSWORD = ''
> DATABASE_HOST = ''
> DATABASE_PORT = '5432'
>
> I added the line 'django.contrib.admin', to my INSTALLED_APPS.
>
> Now whenever I try to access my admin I get the following error:
>
> ProgrammingError: relation "django_session" does not exist
>
> Any Suggestions?
> >
>   


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

2007-11-27 Thread mike

My last post was a little confusing, I have two classes a Customer
class and an Issue class, I would like the customer class to display
issues where the "name" of the customer field matches the "customer"
field of the issues class,  thus listing each customer's issues at a
glance, any help would be appreciated.  thx in advance



class Customer(models.Model):
name = models.CharField(maxlength=100)
service = models.IntegerField(blank=True, default=4,
choices=SERVICE_CODES)
comp = models.IntegerField(blank=True, default=4,
choices=CUSTOMER_TYPES)
email = models.CharField(blank=True, maxlength=100)
phone_number = models.CharField(blank=True, maxlength=100)
phone_number2 = models.CharField(blank=True, maxlength=100)
IP_address = models.CharField(blank=True, maxlength=100)
submitted_date = models.DateField(auto_now_add=True)
modified_date = models.DateField(auto_now=True)
description = models.TextField(blank=True)
list_issues = ???
class Admin:
list_display = ('name', 'service', 'phone_number',
'submitted_date', 'modified_date')
list_filter = ('service', 'submitted_date')
search_fields = ('name',
'description','email','phone_number','IP_address')



class Meta:
ordering = ('service', 'submitted_date', 'name')

def __str__(self):
return self.name

class Issue(models.Model):
issue = models.TextField(blank=True)
date = models.DateField()
customer = models.ForeignKey(Customer, related_name="Customer")

def __unicode__(self):
return self.issue

class Meta:
ordering = ('issue',)
class Admin:
pass


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 admin page

2007-11-27 Thread mike

Hello this is my first post, I work the helpdesk for a small company
and I am trying to design a form to keep track our customers, contact
info and the reason for their calls, I would like my customer form to
list links to notes for each time they called with dates, here is my
currentl models.py any help would be appreciated.


from django.db import models
from django.contrib.auth.models import User
from django.conf import settings

SERVICE_CODES = (
(1, 'DSL'),
(2, 'T1'),
(3, 'HOSTING'),
(4, 'NONE'),
(5, 'Dial-up'),
(6, 'Integrator'),
)


class Issue(models.Model):
issue = models.TextField(blank=True)
date = models.DateField()
customer = models.CharField(blank=True, maxlength=100)

def __unicode__(self):
return self.issue

class Meta:
ordering = ('issue',)
class Admin:
pass

#apps = [app for app in settings.INSTALLED_APPS if not
app.startswith('django.')]
#PROJECTS = list(enumerate(apps))

##project = models.CharField(blank=True, maxlength=100,
choices=PROJECTS)

class Customer(models.Model):
name = models.CharField(maxlength=100)
service = models.IntegerField(blank=True, default=4,
choices=SERVICE_CODES)
email = models.CharField(blank=True, maxlength=100)
phone_number = models.CharField(blank=True, maxlength=100)
phone_number2 = models.CharField(blank=True, maxlength=100)
IP_address = models.CharField(blank=True, maxlength=100)
submitted_date = models.DateField(auto_now_add=True)
modified_date = models.DateField(auto_now=True)
issue = models.ForeignKey(Issue, related_name="Issue")
description = models.TextField(blank=True)

class Admin:
list_display = ('name', 'service', 'phone_number',
'submitted_date', 'modified_date')
list_filter = ('service', 'submitted_date')
search_fields = ('name',
'description','email','phone_number','IP_address')

class Meta:
ordering = ('service', 'submitted_date', 'name')

def __str__(self):
return self.name

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



Re: user restrictions in admin interface

2007-11-27 Thread sam

thx for your answer

ok, the problem, in my case, is that I have got 2 types of users :
- data entry user, who write the content
- admin user, who valid, the content

what I need, finally, is a sort of workflow system, so that my
question is now :
is http://django-goflow.blogspot.com/ able to do this ?

sam

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



Ipod Party

2007-11-27 Thread Casyo

Ipod ... pod... pod...

http://www.freerealms.fr/ipod


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



Re: Error while importing URLconf

2007-11-27 Thread sun . wukong


Le 27.11.2007 17:40,, le perspicace James Bennett s'exprimait en ces termes:
> On 11/27/07, Sun Wukong <[EMAIL PROTECTED]> wrote:
>> But I get this error :
>> Error while importing URLconf 'myblog.personne.urls': cannot import name
>> render_to_reponse
> 
> One of your views is trying to use render_to_response, but is
> apparently looking in the wrong place to import it.

Well, I thought my code failed trying to import some urls.py file. So,
here is the (only one) views.py :

# -*- coding: utf-8 -*-
# Create your views here.
# this file is : myblog/personne/views.py

from django.shortcuts import render_to_reponse
from myblog.personne.models import Personne

def personne_list(request):
"""Consultation de la liste des Personnes"""
print "I am here"
assert False


Thx

-- 
SunWukong

Linux User #354048
GPG Key available : 0xF4DD0AD2 on keyserver.ubuntu.com



signature.asc
Description: OpenPGP digital signature


Re: user restrictions in admin interface

2007-11-27 Thread James Bennett

On 11/27/07, sam <[EMAIL PROTECTED]> wrote:
> I would like that all users logged could modify the title and content
> field (in the standard django admin)
> and I would like that just a category of user can modify the
> publish_status (always in the standard django admin).

You will not be able to accomplish this. The Django admin application
is designed for users who are trusted members of your site staff, not
for people upon whom you need to place these sorts of arbitrary
restrictions. As a general rule, if you don't trust them enough to let
them edit the content, you shouldn't be letting them into the admin in
the first place.


-- 
"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: Error while importing URLconf

2007-11-27 Thread James Bennett

On 11/27/07, Sun Wukong <[EMAIL PROTECTED]> wrote:
> But I get this error :
> Error while importing URLconf 'myblog.personne.urls': cannot import name
> render_to_reponse

One of your views is trying to use render_to_response, but is
apparently looking in the wrong place to import it.


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



user restrictions in admin interface

2007-11-27 Thread sam

hello,

so, I'm new user of django, and I would like to know (or understand)
how to make some fields invisible to some users.
For example, if a model with this 3 fields :  publish_status, title &
content,
I would like that all users logged could modify the title and content
field (in the standard django admin)
and I would like that just a category of user can modify the
publish_status (always in the standard django admin).

?

thx

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



Error while importing URLconf

2007-11-27 Thread Sun Wukong
Hi,

I try to access to the URL http://127.0.0.1:8000/personne/liste/ but get
an error that I can't solve. Thanks for your help.

the URL http://127.0.0.1:8000/personne/liste/ head us to the main
urls.py file

--
from django.conf.urls.defaults import *

urlpatterns = patterns('',
# Example:
# (r'^myblog/', include('myblog.foo.urls')),
(r'^personne/', include('myblog.personne.urls')),

# Uncomment this for admin:
# (r'^admin/', include('django.contrib.admin.urls')),
)
--
and then lead us to myblog.personne.urls.py
--
# -*- coding: utf-8 -*-

from django.conf.urls.defaults import *
from myblog.personne.views import   personne_list, personne_view,
personne_new, \
personne_edit, personne_delete,
personne_search

urlpatterns = patterns('',
# Example:
# (r'^myblog/', include('myblog.foo.urls')),
(r'^(?P\d+)/$', personne_view),
(r'^new/$', personne_new),
(r'^edit/(?P\d+)/$', personne_edit),
(r'^delete/(?P\d+)/$', personne_delete),
(r'^search/([A-Za-z]+)/$', personne_search),
(r'^liste/$', personne_list),
)

But I get this error :
Error while importing URLconf 'myblog.personne.urls': cannot import name
render_to_reponse

Request Method: GET
Request URL:http://127.0.0.1:8000/personne/liste/
Exception Type: ImproperlyConfigured
Exception Value:Error while importing URLconf 'myblog.personne.urls':
cannot import name render_to_reponse
Exception Location:
/usr/lib/python2.5/site-packages/django/core/urlresolvers.py in
_get_urlconf_module, line 255
Python Executable:  /usr/bin/python
Python Version: 2.5.1

-- 
SunWukong

Linux User #354048
GPG Key available : 0xF4DD0AD2 on keyserver.ubuntu.com



signature.asc
Description: OpenPGP digital signature


should we place set_test_cookie/test_cookie_worked on every page?

2007-11-27 Thread jim

In order to test if the browser has cookie support, do we have to
place this cookie test on every function? Is this the general
practice? I mean what happens if a person has cookie support turned on
and while browsing he/she turns it off?

Also, If we use a set_test_cookie on the GET request and a
test_cookie_worked on the POST request, if the user hits the 'BACK'
button on POST page, the browser picks the page from it's cache,
thereby not executing the  set_test_cookie function. So when the user
POST a second time, if will throw an error that the test_cookie_worked
failed. e.g

if request.method == 'GET':
request.session.set_test_cookie()
return render_to_response('register.html',
RequestContext(request, {}))

elif request.method == 'POST':

if request.session.test_cookie_worked():
   request.session.delete_test_cookie()
else:
   return render_to_response('register.html',
RequestContext(request, {'cookie_error':'We have detected that your
browser does not support cookies. This site requires cookies for
proper functioning. '}))

   




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



Error trying to get PostgreSQL to work...setting configuration

2007-11-27 Thread Greg

Hello,
I've added the following to my settings.py file:

DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'postgres'
DATABASE_USER = 'postgres'
DATABASE_PASSWORD = ''
DATABASE_HOST = ''
DATABASE_PORT = '5432'

I added the line 'django.contrib.admin', to my INSTALLED_APPS.

Now whenever I try to access my admin I get the following error:

ProgrammingError: relation "django_session" does not exist

Any Suggestions?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Oracle usage

2007-11-27 Thread Ian

On Nov 26, 7:04 pm, anthony <[EMAIL PROTECTED]> wrote:
> so which means i should be able to get oracle working if i download
> the code from the trunk?

That's correct.  Version 0.96 was released before the Oracle branch
was merged into trunk, so we recommend using trunk for all Oracle
installations.

Ian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 template loader

2007-11-27 Thread jorjun

OK, managed to do this in the end, by creating a new template tag and
node derived from django.template.loader_tag.ExtendsNode
overriding the get_parent method.

Now we have total white labeling of all our templates, including base
templates.

Django rocks.
On 27 Nov, 12:20, jorjun <[EMAIL PROTECTED]> wrote:
> I am trying to work out the best way to allow dynamic template
> substitution based on RequestContext
>
> Could anybody point me in the right direction? I don't know if I need
> a new template loader, or I need to create new tags.
>
> But in this case :
>
> {% extends "myapp/base.html" %}
>
> I would like it to look in "client1_overlay/base.html" if found,
> otherwise to default to the normal template loading mechanism.
> If client2 requests a page, then I need to use a different template
> "client2_overlay/base.html" if found.
>
> Basically I want to customise TEMPLATE_DIRS depending on information
> in the RequestContext. This way I can implement 'dynamic skinning'.
>
> Suggestions, comments, advice greatly welcomed.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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
-~--~~~~--~~--~--~---



Partial Validation in newforms

2007-11-27 Thread PlanarPlatypus

Does anyone know of a clean way to do partial validation in djangos
newforms.  I am basically after a cleaner way to do something like the
code below.

form = form(request.POST, error_class=SpanErrorList)

# Hacky but as of this moment newforms doesn't support partial

# validation or getting the valid data from normal validation

try:

data = form.data['version']

version = form.base_fields['version'].clean(data)

build.version = version

except ValidationError:

pass

try:

data = form.data['build_number']

build_number = form.base_fields['build_number'].clean(data)

build.build_number = build_number

except ValidationError:

pass

try:

data = form.data['changelist']

changelist = form.base_fields['changelist'].clean(data)

build.changelist = changelist

except ValidationError:

pass

try:

data = form.data['comment']

comment = form.base_fields['comment'].clean(data)

build.comment = comment

except ValidationError:

pass

build.save()
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Conditional Block in Template

2007-11-27 Thread gordyt

I would have the render_to_response in the view (or views if the URL
patterns are different) use the appropriate template based upon the
type of request.

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



Conditional Block in Template

2007-11-27 Thread Manakel

Hello All,

Another nasty challenge for me newbie :-)

I have a master Template where i define the blocks that will be
subclassed by
child templates.
(currently blocks are Header,
TitleBar,MenuBar,ToolBar,MainFrame,MessageBar)

Now for my Incident module, i've got several Qualifications
(Support Request, Defect, Change Request) so i would like that based
on this Qualification, the MainFrame block is subclassed by a
different Template.
(meaning different sub list of fields are edited with different
layout)

Like if user edit a Defect , MainFrame will be subclassed by
Template_Defect using the form "Forms_Defect".

Where should i implement the mapping that should be dynamic?
(ie when a new qualification is found, it tries to find template and
forms based on name without manual change into the code)
-> View ?
-> Template ?
-> Template tag?
-> Boths?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 select all the values from my Field attribute 'choices?

2007-11-27 Thread äL

How can I get all values of my "choices"?

I have a template which contains an drop-down-list with all values.
The drop-down-list
has several entries but unfortunatelly only the same. In my choices-
list
I have 5 entries. And in the drop-down-list 5 entries, too (But the
same).

How can I get all values?
From a table it's easy:
Just type "nations   = Country.objects.all()"
With a choice-list "objects.all()" doesn't work.



äL


On 8 Nov., 13:42, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> On 11/8/07, äL <[EMAIL PROTECTED]> wrote:
>
> > Do I have an error in the import syntax? How can I import ROLE?
>
> You don't. Just import Karateka and use Karateka.ROLE.
>
> -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
-~--~~~~--~~--~--~---



yardım bekleyen bir köy okulu

2007-11-27 Thread cansu

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



Re: Default value with SLUGFIELD

2007-11-27 Thread Jonathan Buchanan

On Nov 27, 2007 8:56 AM, Miguel Galves <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've created a slugfield, which should accept 3 values from a list
>
> STATUS = (
> ('PUBLICADO', "Publicado"),
> ('ESPERA', "Aguardando Aprovação"),
>  ('REJEITADO', "Rejeitado"),
> ('SPAM', "Spam"),
> )
>
> status = models.SlugField(choices=STATUS, default='ESPERA', null=True,
> blank=True)
>
> This status field should only be defined by teh admin of my System. So, It's
> not rendered
> in the public model view, using the create_object generic view. I was hoping
> that the default
> value would be used, but the model is saved with STATUS=None. Is there a way
> to enforce
> a default value to this field?
>
> thanks
>
> --
> Miguel Galves - Engenheiro de Computação

You could override your model's save method:

def save(self, **kwargs):
if not self.status:
self.status = 'ESPERA'
super(YourModel, self).save(**kwargs)

Jonathan.

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



Default value with SLUGFIELD

2007-11-27 Thread Miguel Galves
Hi,

I've created a slugfield, which should accept 3 values from a list

STATUS = (
('PUBLICADO', "Publicado"),
('ESPERA', "Aguardando Aprovação"),
('REJEITADO', "Rejeitado"),
('SPAM', "Spam"),
)

status = models.SlugField(choices=STATUS, default='ESPERA', null=True,
blank=True)

This status field should only be defined by teh admin of my System. So, It's
not rendered
in the public model view, using the create_object generic view. I was hoping
that the default
value would be used, but the model is saved with STATUS=None. Is there a way
to enforce
a default value to this field?

thanks

-- 
Miguel Galves - Engenheiro de Computação
Já leu meus blogs hoje?
Para geeks http://log4dev.com
Pra pessoas normais
http://miguelcomenta.wordpress.com

"Não sabendo que era impossível, ele foi lá e fez..."

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 display the euro currency EURO and choose the comma as the decimal separator

2007-11-27 Thread David Reynolds

How about:

CURRENCY = u'€'

?

That's what we had to do to get the pound sign working.

Thanks,

David


On 27 Nov 2007, at 1:39 pm, Song.qk wrote:

>
> I am just using the basic Satchmo templates WITHOUT ANY
> modifications.
>
> On Nov 27, 8:04 pm, "Horst Gutmann" <[EMAIL PROTECTED]> wrote:
>> First of all: How do you render your prices in the first place?
>>
>> Regards, Horst
>>
>> On Nov 27, 2007 8:18 AM, Song.qk <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> Hello world,
>>
>>> I've tried many things with no avail to make appear the Euro symbol.
>>> I've put the line
>>> # encoding: utf-8
>>> at the beginning of the local_settings.py and added
>>
>>> CURRENCY = 'EURO'
>>
>>> But that does not seem to work, my product prices are still  
>>> displayed
>>> with the $ symbol.
>>
>>> On the other hand I have two other questions:
>>> 1- how to establish the comma ',' as the decimal separator ?
>>> 2- how to display the symbol on the right instead of the left as  
>>> it is
>>> usual in Europe?
>>
>>> Thanks.
>>
>>> Quentin
> >

-- 
David Reynolds
[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: How to display the euro currency EURO and choose the comma as the decimal separator

2007-11-27 Thread Song.qk

I am just using the basic Satchmo templates WITHOUT ANY
modifications.

On Nov 27, 8:04 pm, "Horst Gutmann" <[EMAIL PROTECTED]> wrote:
> First of all: How do you render your prices in the first place?
>
> Regards, Horst
>
> On Nov 27, 2007 8:18 AM, Song.qk <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello world,
>
> > I've tried many things with no avail to make appear the Euro symbol.
> > I've put the line
> > # encoding: utf-8
> > at the beginning of the local_settings.py and added
>
> > CURRENCY = 'EURO'
>
> > But that does not seem to work, my product prices are still displayed
> > with the $ symbol.
>
> > On the other hand I have two other questions:
> > 1- how to establish the comma ',' as the decimal separator ?
> > 2- how to display the symbol on the right instead of the left as it is
> > usual in Europe?
>
> > Thanks.
>
> > Quentin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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
-~--~~~~--~~--~--~---



getting error messages to display

2007-11-27 Thread Kenneth Gonsalves

hi,

in my new forms I am doing custom validation. Some of these do not  
fit into the 'clean()' method, so I do it in the body of my view.  
Code is like this

if form.is_valid:
if some cleaned_data['speaker'] does not pass test:
form.errors['speaker'] = ['some error here']
if not form.errors:
savethe form

when I publish my form as form.as_table - the error appears correctly  
next to the 'speaker' widget. But when I break up the form like this:


{% for field in form %}
{{ field.label_tag }}

{{ field }}
{% if field.help_text %}{{ field.help_text }}{% endif %}
{% if field.errors %}{{ field.errors }}{%  
endif %}
{% endfor %}

The error message does not display: The display is simply []
How do I solve this?

-- 

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: URL Regex Grouping

2007-11-27 Thread P

Hi Malcolm,

Thanks for the response - at least I know its not something I am doing
wrong now!  Do you know when the updated code will be available?
Would it be possible to have a copy of the code in its current state
so I can get the site working as intended?

Thanks again for your help.

Phil

On Nov 11, 12:08 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sat, 2007-11-10 at 10:19 -0800, P wrote:
>
> [...]
>
> > My problem is not with mapping theurlto the correct view, it is with
> > using {%url%} tag to look up the namedurlpattern.  It seems that I
> > can only get {%url%} to work if I do not include the regex grouping
> > in the above pattern (which is required to specify parts of the
> > pattern as optional).
>
> That is correct at the moment. It will be fixed shortly. SmileyChris
> wrote a patch to mostly do this. I have a modified version of that patch
> sitting in my tree and I'll finish cleaning it up soon and commit it.
>
> Malcolm
>
> --
> Success always occurs in private and failure in full 
> view.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
-~--~~~~--~~--~--~---



Dynamic template loader

2007-11-27 Thread jorjun

I am trying to work out the best way to allow dynamic template
substitution based on RequestContext

Could anybody point me in the right direction? I don't know if I need
a new template loader, or I need to create new tags.

But in this case :

{% extends "myapp/base.html" %}

I would like it to look in "client1_overlay/base.html" if found,
otherwise to default to the normal template loading mechanism.
If client2 requests a page, then I need to use a different template
"client2_overlay/base.html" if found.

Basically I want to customise TEMPLATE_DIRS depending on information
in the RequestContext. This way I can implement 'dynamic skinning'.

Suggestions, comments, advice greatly welcomed.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: FlatPage and Internationalization

2007-11-27 Thread Marcin Kaszynski

On Nov 27, 11:10 am, Tim <[EMAIL PROTECTED]> wrote:
> For multilingual sites, is it not easier to maintain and keep all the
> translations in .po files? The idea of splitting up the required
> translations would mean that translators must use two different
> interfaces.

Well, those are two different sets of translators :)

It is the difference between code and content.  The .po files, just
like template files and all texts hardcoded in models and views and,
are 'code' and flatpages are usually the 'content' of your site.  The
latter are supposed to differ for separate installations of your app,
safer, changeable without modifications to the application code,
without risking breaking anything and thus editable by a larger group
of people.  This difference should be passed on to translations as
well.

I realize this line may be blurry in some cases, but a good way of
discovering where it goes is to think about using your app or project
as a base for two different sites.

As for the original question, there is at least one app that gives you
flatpages with translations, based on django.contrib.flatpages and
midified to use django-multilingual (http://code.google.com/p/django-
multilingual/issues/detail?id=30); I did not have the time to add it
to the multilingual library yet (unfortunately, this is where the "as
time permits" part kicks in), but hope to do so soon.  Should be
simple to install and try out and I would be happy to have some
feedback on what and how it does :)

-mk

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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 display the euro currency EURO and choose the comma as the decimal separator

2007-11-27 Thread Horst Gutmann

First of all: How do you render your prices in the first place?

Regards, Horst

On Nov 27, 2007 8:18 AM, Song.qk <[EMAIL PROTECTED]> wrote:
>
> Hello world,
>
> I've tried many things with no avail to make appear the Euro symbol.
> I've put the line
> # encoding: utf-8
> at the beginning of the local_settings.py and added
>
> CURRENCY = 'EURO'
>
> But that does not seem to work, my product prices are still displayed
> with the $ symbol.
>
> On the other hand I have two other questions:
> 1- how to establish the comma ',' as the decimal separator ?
> 2- how to display the symbol on the right instead of the left as it is
> usual in Europe?
>
> Thanks.
>
> Quentin
> >
>

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



'sites' framework

2007-11-27 Thread veearrsix

I've recently added the sites framework but i'm noticing that the
SITE_ID (settings.SITE_ID), is returning an id of a site that doesn't
exist. I'm running on the development server @127.0.0.1:8000, this
obviously doesn't relate to any of the sites that I have added within
the sites table.

It is affected the freecomments app as it is posting 'correctly' the
SITE_ID, that is being return from the settings.SITE_ID, but as this
id doesn't exist in the sites table (i'm assuming), the comments just
disappear from the admin interface and also from my generic view. The
comment count is incremented correctly, but the actually comments
disappear.

Looking at the comments table directly in the database, the comments
are all present and correct.

Any ideas what might be happening?


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



Problems loading fixtures using loaddata

2007-11-27 Thread Divan Roulant

Hello!

I outputted an xml file with the "dumpdata" command using manage.py. I
didn't dump data per model, I just dumped it in a single file that I
named "initial_data.xml". Now, when I try to upload it with
"loaddata", it fails. Sometimes, it doesn't find paths (my project
handles pictures), sometimes, foreign keys are not ok.

For those of you who are using loaddata, should loaddata be as
straighforward as to dumpdata and then load it (after cleaning the
database) or are there other steps in between that I am missing?

Thanks!

Divan


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: exporting related data without killing the db

2007-11-27 Thread lispingng

Thanks,
actually i have been baulking a little cos i have not yet studied
writing custom sql in django.
I'll get on with it and check on you with more specific issues as they
appear.

On Nov 26, 12:13 pm, jj <[EMAIL PROTECTED]> wrote:
> I solved a similar issue using custom SQL. It's a little tedious to
> write, but the boost is significant.
>
> The way I've structured this:
> 1. create a manager for the main class
> 2. for each related object (either foreignKey or many2many), create a
> method fieldname_in_bulk()
> 3. create a method select_related_ex(), which uses the results of 2.
>
> More concretely:
> 2. fetches all related objects (irrespective of the object(s) to which
> it is attached)
> 3. associates objects and their related objects
>
> If your DB and model won't change too often, you can write pretty
> clear and concise SQL/SQL processing code.
>
> JJ.
>
> On Nov 26, 11:56 am, lispingng <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > I am working on a large project that requires i export applications to
> > csv.
> > the problem is the Application model has about six foreignkey fields
> > including one to the Profiles model. also there are two backward
> > relations to the Application models as well
> > in other words the model structure is a little complex.
> > now i want to export the data (its a school management app) with their
> > relationships
>
> > class Application(models.Model):
> > profile = models.ForeignKey(Profiles, editable=False)
> > ...
> > ...
> > class School(models.Model):
> > '''the schools attended by the applicant'''
> > application = models.ForeignKey(Application)
>
> > class WorkExperience(models.Model):
> > '''the jobs doen by the applicant'''
> > application = models.ForeignKey(Application)
>
> > and so on.
> > right now i am looking for an alternative to picking each Aplication
> > object, one by one, and using select_related() to get related data
> > also thought about using custom sql but am not sure it is the right
> > thing to do...(maybe i'm just being lazy)
> > Any thoughts on how i can get around 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: {% include %} or template_tag?

2007-11-27 Thread Jonathan Buchanan

On Nov 27, 2007 5:42 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> A small question about template godd practices.
> I have to display lists of elements in various pages, with each
> element formatted as HTML table (with progress bars and other widgets,
> without going in too deep details).
>
> Currently every page duplicates the HTML code to display those
> elements.
> I was thinking of refactoring the code, either:
> - using the {% include %} tag with a dedicated template for those
> elements, but as i loop through my elements, Django will read the
> template file many times (or is there some cache-ability in template
> loading?)
> - building a template_tag, but I would like to limit the use of
> template_tags (especially to limit the complexity of templates for
> other maintainers of my code).
>
> Are there any good practices or any better directions I should take?
> Thanks in advance.

Option 3 - do both! :)

Writing an inclusion tag [1] would allow you to pass the item you want
to use in your included template (instead of relying on a context
variable with a certain name being in place), e.g. {% render item
my_item %}, and would also give you a good place to prepare or load
any other information required to display each item.

Jonathan.

[1] http://www.djangoproject.com/documentation/templates_python/#inclusion-tags

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



{% include %} or template_tag?

2007-11-27 Thread [EMAIL PROTECTED]

Hi,

A small question about template godd practices.
I have to display lists of elements in various pages, with each
element formatted as HTML table (with progress bars and other widgets,
without going in too deep details).

Currently every page duplicates the HTML code to display those
elements.
I was thinking of refactoring the code, either:
- using the {% include %} tag with a dedicated template for those
elements, but as i loop through my elements, Django will read the
template file many times (or is there some cache-ability in template
loading?)
- building a template_tag, but I would like to limit the use of
template_tags (especially to limit the complexity of templates for
other maintainers of my code).

Are there any good practices or any better directions I should take?
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
-~--~~~~--~~--~--~---



IRC Channel

2007-11-27 Thread David Reynolds

Hi,

I've just noticed that the irc channel has lost the mode that lets  
anyone set the topic, so now only ops can do it. However, there  
doesn't seem to be any ops.  Is anyone able to fix it? I wanted to  
add something about the djangosprint to the topic.

Thanks,

Dave / Paperface on #django

-- 
David Reynolds
[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: using geneirc views to delete more than one row

2007-11-27 Thread Jonathan Buchanan

On Nov 27, 2007 3:07 AM, Sawan V <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> Is there any way to use the
> django.views.generic.create_update.update_object  to update all the
> rows in a table?
>
> Example: my model contains a table with 2 columns,  role and name. For
> a given row, role is constant and does not change but name can.
>
> I want to write one simple page where I can present all the data in
> the table, have the user update names as desired and then have the
> changes applied in one go.
>
> Any other option besides the generic view?
>
> Thanks
>
> Sawan

The "prefix" argument for newforms makes this easy enough:

Example view, which might have taken "have the changes applied in one
go" a bit too literally:

from django import newforms as forms
from django.db import connection, transaction
from django.shortcuts import render_to_response
from django.template import RequestContext

from yourapp.models import RoleName

class UpdateNameForm(forms.Form):
name = forms.CharField()

def __init__(role_name, *args, **kwargs):
super(UpdateNameForm, self).__init__(*args, **kwargs)
self.fields['name'].initial = role_name.name
self.role_name = role_name

def update_names(request):
role_names = RoleName.objects.all()
if request.method == 'POST':
forms = [UpdateNameForm(rn, data=request.POST, prefix='rn%s' % rn.pk) \
 for rn in role_names]
all_valid = True
for form in forms:
if not form.is_valid() and all_valid:
all_valid = False
if all_valid:
opts = RoleName._meta
cursor = connection.cursor()
cursor.executemany('UPDATE %s SET %s=%%s WHERE %s=%%s' % (
connection.ops.quote_name(opts.db_table),
connection.ops.quote_name(opts.get_field('name').column),
connection.ops.quote_name(opts.pk.column)),
[(form.cleaned_data['name'], form.role_name.pk) \
 for form in forms])
transaction.commit_unless_managed()
else:
forms = [UpdateNameForm(rn, prefix='rn%s' % rn.pk) for rn in role_names]

return render_to_response('yourapp/update_names.html', {
'forms': forms,
}, context_instance=RequestContext(request))

Example template showing the data you'll be interested in when
building your template:

{% for form in forms %}
{{ form.role_name.role|escape }}
{% if form.name.errors %}{{ form.name.errors.as_ul }}{% endif %}
{{ form.name.label_tag }} {{ form.name }}
{% endfor %}

Jonathan.

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



Re: Preferred Schema Evolution Tool

2007-11-27 Thread Russell Keith-Magee

On 11/27/07, Massimiliano Ravelli <[EMAIL PROTECTED]> wrote:
>
> On 25 Nov, 10:21, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > What is the recommended method to do this right now, what are you all
> > using, just plain SQL? Basically, I'm looking for the best solution to
> > this problem and would like to know what the community recommends.
>
> I can't raccomand you any of these but I can say that, after
> a long waiting, I found the project *I* like and fits *my* needs:
> Django Evolution.
>
> Here's some point about django evolution:
> - good documentation
> - clean and elegant (like django ;-) )
> - works with a recent version of trunk
> - intergrates with django management without patching it
>   (thanks to the recent version of django itself)
> - I can avoid to add information about evolution to my models
> - helps to track and apply changes to the database.

Thanks for the compliments. I'm glad Django Evolution meets your needs.

> I know: it can handle automatically only few case.
> It doesn't support DeleteModel mutation... but I don't care:
> I know a bit of sql and I can write a "DROP TABLE" statement. ;-)

FYI - DE will support DeleteModel very soon. There is a prototype
implementation attached to ticket #12; this patch requires a few minor
tweaks before it is committed, but with any luck, I'll get a chance to
put some time into this very soon.

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: FlatPage and Internationalization

2007-11-27 Thread Tim

For multilingual sites, is it not easier to maintain and keep all the
translations in .po files? The idea of splitting up the required
translations would mean that translators must use two different
interfaces. There are frameworks for translating .po files that keep
revisions, suggestions etc. These would not be available. Do you think
it would be possible to have the contents of flatpages parsed by the
template parser before being displayed? If the scripts that generate
the .po files could also parse these, translations could be maintained
at a single point. I have never looked at the django code before so I
don't know what's viable.

On second thoughts it seems what I'm proposing is to store flat pages
as templates in a database so they are easily editable. Hmmm, maybe
that's not such a good idea after all.

What are your opinions on this?

Cheers,
Tim

On Nov 9, 3:19 pm, DvD <[EMAIL PROTECTED]> wrote:
> That's what i am about to do, but if guys from the development team
> agree we could implement it in the official django code
>
> On Nov 9, 3:34 pm, Eugene Morozov <[EMAIL PROTECTED]> wrote:
>
> > I've implemented similar system. Only I have used MyFlatPage and
> > MyFlatPageTranslation models, because it makes easier to locate and
> > translate pages in the admin interface.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Preferred Schema Evolution Tool

2007-11-27 Thread Massimiliano Ravelli

On 25 Nov, 10:21, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> What is the recommended method to do this right now, what are you all
> using, just plain SQL? Basically, I'm looking for the best solution to
> this problem and would like to know what the community recommends.

I can't raccomand you any of these but I can say that, after
a long waiting, I found the project *I* like and fits *my* needs:
Django Evolution.

Here's some point about django evolution:
- good documentation
- clean and elegant (like django ;-) )
- works with a recent version of trunk
- intergrates with django management without patching it
  (thanks to the recent version of django itself)
- I can avoid to add information about evolution to my models
- helps to track and apply changes to the database.

I know: it can handle automatically only few case.
It doesn't support DeleteModel mutation... but I don't care:
I know a bit of sql and I can write a "DROP TABLE" statement. ;-)


I read the documentation of all these projects to make my choice.
As it doesn't take to much time, I advise you to do the same
to chose the project that better  fits your needs.


Regards
Massimiliano

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Publishing

2007-11-27 Thread Graham Dumpleton

You need then to give the exact error messages from the Apache error
logs or browser then, rather than us having to guess what they are.
Also do the following:

1. Check that all files and directories back up to root of file system
are readable/searchable to the user that Apache runs as. If they
aren't Python running under mod_python will not be able to load the
files.

2. Post a copy of your urls.py file so can validate it is correct for
the mod_python configuration you are using.

Graham

On Nov 27, 11:58 am, Mike Feldmeier <[EMAIL PROTECTED]> wrote:
> Thank you for your response,
>
> The 'test' is actually just a stand-in name for this posting.
>
> Thanks,
> Mike
>
> On Nov 26, 7:10 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
> > FWIW, you should never call stuff that might be interpreted as a
> > Python module, 'test'. This is because there is a standard Python
> > module of that name. Thus, depending on sys.path order, it could pick
> > up the standard Python module instead of your site package.
>
> > Thus, for a start, trying to recreating your project with a different
> > name than 'test'.
>
> > Graham
>
> > On Nov 27, 6:30 am, Mike Feldmeier <[EMAIL PROTECTED]> wrote:
>
> > > Using:
>
> > > Ubuntu (gutsy)
> > > Apache (2.2.4)
> > > Python (2.5.1)mod_python(3.3.1)
>
> > > I have a project with two projects underneath "local_apps.general" and
> > > "shared.blog".  Running the development server, everything runs great.
>
> > > 
> > > /home/mike/www/www.test.com/
> > > test/
> > > settings.py
> > > urls.py
> > > ...
> > > local_apps/
> > > general/
> > > urls.py
> > > models.py
> > > shared/
> > > blog/
> > > urls.py
> > > models.py
> > > 
>
> > > Now switching to production under Apache, it recognizes the project,
> > > but not the applications.  I've been through the tutorials, the book,
> > > Google, but nothing seems to work.  I keep getting No module named x
> > > pages.
>
> > > Here are my apache settings:
>
> > > 
> > > 
> > > ServerAdmin [EMAIL PROTECTED]
> > > ServerName test
> > > DocumentRoot /home/mike/www/www.test.com/
> > > 
> > > Options FollowSymLinks
> > > AllowOverride None
> > > 
> > > 
> > > SetHandler python-program
> > > PythonHandler django.core.handlers.modpython
> > > SetEnv DJANGO_SETTINGS_MODULE test.settings
> > > PythonDebug On
> > > PythonPath "['/home/mike/www/www.test.com/', '/home/
> > > mike/www/www.test.com/test/'] + sys.path"
> > > 
> > > 
> > > SetHandler None
> > > 
>
> > > ErrorLog /var/log/apache2/error.log
>
> > > LogLevel warn
>
> > > CustomLog /var/log/apache2/access.log combined
>
> > > ServerSignature On
>
> > > 
> > > 
>
> > > Thanks for any insights,
> > > Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Cambridge and East Anglia Python Users Group

2007-11-27 Thread David Reynolds

Posted on my local LUG list, thought it may be of interest to some  
people here too:


> Dear ALUG,
>
> The second meeting of the Cambridge and East Anglia Python Users Group
> will be held on Tuesday 4th December at 20:00 in the Calrton Arms
> (Carlton Way, Cambridge).
>
> There are a few agenda items this time
>
> * when pub meetings are
> * whether we want to join O'Reilly's discount scheme
> * some discussion about how we might organise talks (particularly
>   where)
>
> Feel free to mail me on- or off-list regarding this if you like.
>
> Cheers,
> Richard
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Richard Lewis - UEA, MUS PG
> http://www.richard-lewis.me.uk/
> JID: [EMAIL PROTECTED]
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>
> http://www.thecarltonarms.co.uk/
> http://groups.google.com/group/campug
> http://www.pyconuk.org/community/Cambridge_and_East_of_England

-- 
David Reynolds
[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: Django and PyAMF, AMF remoting

2007-11-27 Thread Bert Heymans

Hi Arnar,

Thanks for clearing that up, that explains why it works in the context
django and not just in the python shell. I understand now, I'll stop
by the pyamf developers list for sure this week :)

Cheers,

Bert

On Nov 26, 6:50 pm, Arnar <[EMAIL PROTECTED]> wrote:
> Hello Bert,
>
> Sorry for the late reply.
>
> On Nov 22, 3:50 pm, Bert Heymans <[EMAIL PROTECTED]> wrote:
>
>
>
> > Installing went fine (sudopythonsetup.py install), and the tests are
> > OK (pythonsetup.py test) but somehow I can't access thedjango
> > package. This is the output I get in a terminal:
>
> >Python2.5 (r25:51918, Sep 19 2006, 08:49:13)
> > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.>>> 
> > from pyamf.gateway.djangoimport DjangoGateway
>
> > Traceback (most recent call last):
> >   File "", line 1, in 
> >   File "pyamf/gateway/django.py", line 37, in 
> > _thismodule = sys.modules['django']
> > KeyError: 'django'>>> import pyamf.gateway
> > >>> dir(pyamf.gateway)
>
> > ['BaseGateway', 'ServiceRequest', 'ServiceWrapper', '__builtins__',
> > '__doc__', '__file__', '__name__', '__path__', 'remoting', 'sys',
> > 'traceback', 'types']
>
> > You see, no 'django' in the list. Anyway, if I look at the sourcecode
> > it's all there in the gateway package there's 'django', 'twisted' and
> > 'wsgi'.
>
> It is finding the pyamf.gateway.djangopackage allright, the line it
> fails on is in that module. IsDjangoon yourpythonpath?
>
> It is due to a trick we have to use to both call our subpackage
> "django" and still be able to import the real (top-level)django
> package. The trick is to mess with sys.modules a bit (see the code).
>
> Please stop by on the pyamf developers list and post us steps to
> reproduce this and we'll sort it out.
>
> cheers,
> Arnar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, 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: Consistency between Django syndication framework & generic views (at least)

2007-11-27 Thread [EMAIL PROTECTED]

Up, unless I need to move it to django-dev list ?

On 20 nov, 14:30, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> After reading and viewing the screencast on syndication framework [1],
> I let a comment on the site where the "obj" comes from ?
>
> Michael points me to the right url and the answer in the doc [2]
>
> [1]  episode-001>
> [2]   simple-example>
>
> My concerns is that even if it's two distinct features of Django,
> naming convention should be the same I think and that "object" should
> be used instead of "obj". At least for consistence purposes.
>
> I do not know if it applies to other part of Django.
>
> Does it make sense ?
>
> Nicolas
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



i18n - gettext issue with simple quote

2007-11-27 Thread [EMAIL PROTECTED]

Hello,

In my po file, I need some french words with simple quote like :

#: models.py:497
msgid "User's skills"
msgstr "Compétences d\'un utilisateur"

But when I use compile-message.py , I got fatar errors and as a reason
"Invalid control sequence".

I removed the "\" but same issue.

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



using geneirc views to delete more than one row

2007-11-27 Thread Sawan V

Hello,

Is there any way to use the
django.views.generic.create_update.update_object  to update all the
rows in a table?

Example: my model contains a table with 2 columns,  role and name. For
a given row, role is constant and does not change but name can.

I want to write one simple page where I can present all the data in
the table, have the user update names as desired and then have the
changes applied in one go.

Any other option besides the generic view?

Thanks

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