db lookup filter: a=b-1

2006-09-06 Thread jaro

I am trying to create filter on db lookup that would do something like
that:
select * from x where a = b-1
Do I need to go with custom SQL ?
-- jaro


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



Re: How about a Django apps public repository?

2006-09-06 Thread Marc D.M.

On Thu, 2006-09-07 at 13:50 +0900, Sean Schertell wrote:
> I wonder how many of us are writing nearly identical apps at any  
> given time. For example, I just hired a guy to write a really basic  
> newsletter app for my project. Now I'm working on a fairly typical  
> "upcoming events" schedule. And soon I'll be working on a simple  
> photo gallery that makes thumbnails as you upload, etc. 

And I'm now putting the finishing touches on a custom FileBrowseField
that allows you to select the file in a popup. This popup has multiple
file uploading, and could do well with the thumbnailing.

I'm also using nesh's thumbnailer right now. (search the mailing lists
for it). the thumbnail template tag works beautifully. 

> I'd bet  
> dollars to donuts that many of you have written these apps already.
> 
or soon finish.

> Wouldn't Django be that much sexier if it came with an ever-expanding  
> repository of apps that we could all share with each other? The fact  
> that apps are modular plug-and-play in Django is *really* cool (Rails  
> can't do that). So why not leverage the "pluggability" of Django's  
> app architecture by making a bunch of these apps public?

And we'd eventually have apps that build on other apps. Can you smell a
zope?

> 
> Am I alone on this? If I created such a repository would anyone use it?

No you're not. I definetly +1 you on this.

> 
> Sean
> 

Marc DM


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



Re: How about a Django apps public repository?

2006-09-06 Thread Ian Holsman

I started thinking of writing one, and have got the basic data model
and how I think it would operate worked out.

it's just a matter of getting enthused enough to actually sit down  
and write it.

regards
Ian

On 07/09/2006, at 2:50 PM, Sean Schertell wrote:

>
> I wonder how many of us are writing nearly identical apps at any
> given time. For example, I just hired a guy to write a really basic
> newsletter app for my project. Now I'm working on a fairly typical
> "upcoming events" schedule. And soon I'll be working on a simple
> photo gallery that makes thumbnails as you upload, etc. I'd bet
> dollars to donuts that many of you have written these apps already.
>
> Wouldn't Django be that much sexier if it came with an ever-expanding
> repository of apps that we could all share with each other? The fact
> that apps are modular plug-and-play in Django is *really* cool (Rails
> can't do that). So why not leverage the "pluggability" of Django's
> app architecture by making a bunch of these apps public?
>
> Am I alone on this? If I created such a repository would anyone use  
> it?
>
> Sean
>
> >

--
Ian Holsman
[EMAIL PROTECTED]
http://VC-chat.com It's what the VC's talk about



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



How about a Django apps public repository?

2006-09-06 Thread Sean Schertell

I wonder how many of us are writing nearly identical apps at any  
given time. For example, I just hired a guy to write a really basic  
newsletter app for my project. Now I'm working on a fairly typical  
"upcoming events" schedule. And soon I'll be working on a simple  
photo gallery that makes thumbnails as you upload, etc. I'd bet  
dollars to donuts that many of you have written these apps already.

Wouldn't Django be that much sexier if it came with an ever-expanding  
repository of apps that we could all share with each other? The fact  
that apps are modular plug-and-play in Django is *really* cool (Rails  
can't do that). So why not leverage the "pluggability" of Django's  
app architecture by making a bunch of these apps public?

Am I alone on this? If I created such a repository would anyone use it?

Sean

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



Backwards relation (ie XXX_set) across apps

2006-09-06 Thread Jay Parlar

In my project, I have a photo gallery app (stockphoto, to be precise),
as well as an 'articles' app. The basic layout is that in the photo
gallery app, I have:

class Photo(models.Model):
image = models.ImageField(...)
etc. etc.


In the 'articles' app, I have the following:

from myproject.stockphoto.models import Photo

class Article(models.Model):
title = models.CharField(maxlength=200, unique=True)
slug = models.SlugField(prepopulate_from=['title'])
body = models.TextField()
picture = models.ForeignKey(Photo, blank=True,null=True)


In the Admin, everything works fine and dandy. When adding new
Articles, I can either point them at existing pictures, or add new
pictures.

And instances of 'Article' do what you would expect.

Instances of 'Photo' do not though. I *should* be able to do something like:

>>> x = Photo.objects.all()[0]
>>> articles = x.article_set.all()

(I want to be able to find all the articles a given picture has been used in).

This is decidedly not working. The reason being is that my instances
of Photo *never* have an 'article_set' attribute.

The only reason I can guess is that because the two models are defined
in separate applications.

Am I missing something here?

Jay P.

PS. An interesting (and perhaps related) sidenote: In my
INSTALLED_APPS, I *have* to have the 'stockphoto' app appear before
the 'articles' app, otherwise I get the following when trying to
import 'Article' in IPython:

ImportError: No module named model

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



Re: Dojo Editor2 invocation from Django

2006-09-06 Thread Gloria

OK, so here is what I'm trying to render from the Django view (so I
don't have to deal with the correct way to reference static content
just yet):

# Create your views here.
from django.http import HttpResponse

def index(request):
return HttpResponse('''


 dojo.require("dojo.widget.Editor");






...It could scarcely be easier.





''')


My urls.py looks like this:

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

(r'^tp/', include('tp')),
(r'/?editor/', 'tp.editor.views.index'),
(r'^annotator/', 'tp.annotator.views.index'),
#(r'^media/(?P.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT})
# Uncomment this for admin:
(r'^admin/', include('django.contrib.admin.urls')),
)


I am close. I get the box with the text, but no functional javascript.

Thank you in adavce for your help,
~G~


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



Re: Shared Hosting suggestion

2006-09-06 Thread Don Arbow

On Sep 6, 2006, at 5:52 PM, Elvis [Brazil] wrote:
>
> Any of you have run a django application in a shared hosting
> successfully? Is it possible?
> Any hosting company you'd like to suggest?




The django website has a list (at least 20) of web hosts you can run  
django on.

http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts

Don


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



Re: Shared Hosting suggestion

2006-09-06 Thread James Bennett

On 9/6/06, Elvis [Brazil] <[EMAIL PROTECTED]> wrote:
> Any of you have run a django application in a shared hosting
> successfully? Is it possible?
> Any hosting company you'd like to suggest?

Pretty much any shared hosting service that supports Python and
FastCGI will work (some offer mod_python, but not a lot of them, so
FastCGI is usually the way to go on shared).

I'm quite happy with TextDrive [1] (disclaimer: I'm not an employee of
TextDrive, but I do know some of the people who run it and have worked
with them in the past), and they have a manual (disclaimer: written by
me) on how to set up Django on their shared plans

Dreamhost[2] also has all the necessary bits to support Django, and I
believe there's a page on their wiki about how to set it up.

[1] http://textdrive.com/
[2] http://dreamhost.com/

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

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



Re: Shared Hosting suggestion

2006-09-06 Thread Joshua D. Drake

Elvis [Brazil] wrote:
> Any of you have run a django application in a shared hosting
> successfully? Is it possible?
> Any hosting company you'd like to suggest?

We do it (http://www.commandprompt.com/)

We setup a seperate apache server instance just for you and then use a 
master proxy.

> 
> thanks,
> Elvis
> 
> 
> > 


-- 

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
  http://www.commandprompt.com/



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



Shared Hosting suggestion

2006-09-06 Thread Elvis [Brazil]

Any of you have run a django application in a shared hosting
successfully? Is it possible?
Any hosting company you'd like to suggest?

thanks,
Elvis


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



Re: Diamanda Wiki and MyghtyBoard Forum on SVN now

2006-09-06 Thread limodou

On 9/7/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> extra markups could be probably used. I've didn't use markdown or
> textile as they don't realy offer a full markup set for documents (and
> they "destroy" ContentBBcode or its output. I'll probably add some
> basic wiki syntax for formating but it won't substitute HTML.
>
I think wiki syntax is better.

-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad

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



Re: Showing the value of a choice instead of the key

2006-09-06 Thread Malcolm Tredinnick

On Wed, 2006-09-06 at 22:40 +, cyberco wrote:
> My model has a choice field:
> 
> ===
> class Foo(models.Model):
> STATUS = (
> ('C', 'Created'),
> ('E', 'Edited'),
> ('F', 'Finished'),
> )
> status = models.CharField(maxlength=1, choices=STATUS)
> ===
> 
> Now in my template I want to display the full name, not the key of the
> choice (as I get when using {{ foo.status}}  ). How?

Your model will have a method called get_status_display() that returns
the displayable string for the current value of the 'status' field.

This is documented in a slightly non-intuitive location -- [1] -- so you
haven't overlooked something that is entirely obvious.

[1] http://www.djangoproject.com/documentation/db_api/#get-foo-display

Regards,
Malcolm



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



Showing the value of a choice instead of the key

2006-09-06 Thread cyberco

My model has a choice field:

===
class Foo(models.Model):
STATUS = (
('C', 'Created'),
('E', 'Edited'),
('F', 'Finished'),
)
status = models.CharField(maxlength=1, choices=STATUS)
===

Now in my template I want to display the full name, not the key of the
choice (as I get when using {{ foo.status}}  ). How?


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



Re: Dojo Editor2 invocation from Django

2006-09-06 Thread gabor

patrickk wrote:
> I´ve been able to use my filebrowser with fckeditor within hours. I 
> ´ve customized the upload- and link-dialogs and everything works fine.
> on the other hand, just take a look at the tinymce-configuration  
> (there´s a lot you can do).

did you connect the upload-dialog to django?

(or you simply used php or something like that?)

gabor


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



Re: Dojo Editor2 invocation from Django

2006-09-06 Thread Gloria

Patrick, thank you. I appreciate this feedback.


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



Re: Dojo Editor2 invocation from Django

2006-09-06 Thread patrickk

I´ve had problems with rich-text-editors for a while now, tested  
everyone with regards to how easy they are to customize and how clean  
is the code they generate ...

Am 06.09.2006 um 21:51 schrieb Gloria:

>
> Thank you for your responses. The steps Patrickk lists are  
> repretitive,
> just like the ones listed in the link I had referenced, except #4 and
> the comment below it. Those were helpful, thank you.
>
> Re: The bugs in the Dojo Editor2: Are they so serious that you would
> not consider fixing them if you were a rich text javascript developer,
> looking for an editor to incorporate into your product?

I´ve tried for about 2 months, giving up in the end (one of the  
reasons is that we don´t use dojo anymore).
still, the new Editor2 is very good (in theory) and if you have a  
good js-developer, why not play with it? one thing that turns me off  
though is that editor2 doesn´t support XHTML, so there´s a lot of  
search/replace if (for instance) you want to have  ...

>
> Re: FckEditor: Is it mature enough to be used in a product? Do any
> products currently use it? Isn't it easy to remap the key sequences  
> for
> break vs. paragraph? Or is this deeply embedded in the code for some
> reason?

I don´t think that problem is easy to solve. it´s a major issue for  
the next update of fckeditor. on the forum, a lot of people complain  
about it (including myself).
e.g., when the editor is empty you are not able to control whether  
the generated html-code is using paragraphs or not (of course, you  
could prepoluate empty textareas with , but that´s not  
nice). with tinymce, you can say that every "enter" results in a new  
paragraph (every "shift-enter" is a break).

>
> Re: TinyMce: I hear great things about this editor, but not from
> developers. I need to be able to customize the editor I ultimately
> choose. I hear it's not as mature as the Dojo editor. Is this true?

I´ve been able to use my filebrowser with fckeditor within hours. I 
´ve customized the upload- and link-dialogs and everything works fine.
on the other hand, just take a look at the tinymce-configuration  
(there´s a lot you can do). I didn´t use tinymce for a project, but  
with the problem in fck mentioned above we´re about to switch.

I´d recommend testing every editor with different browsers and see  
how it works. shouldn´t take you more than a day - and maybe your  
experience is different ...

patrick

>
> Should this be taken offline, because it's tangential to Django? Or
> should it be left here for others looking to integrate rich text
> editing?
>
>
> >


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



Deep relationships

2006-09-06 Thread inkieminstrel

I'm trying to follow several table relationships to get from one object
to another and I can't find a way of doing so that feels right.  This
is my code:

user.userpage_set.get(nice_name=page_name).page.page_type.view_name

In case it's not apparent, that's relationship spanning the following
models, in order, arrows indicating the direction of the relationship:
User <- UserPage -> Page -> PageType

My code requires 3 queries, but it seems like it should be able to be
done in 1.  Is there a preferred way to load additional tables in a way
that spans a deep relationship?

Also, is there a way to just load a single relationship instead of all
relationships (as select_related() does)?  I'm assuming if there is an
answer to the above, it'll answer that question also.

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



Re: Question on Modifying the admin interface.

2006-09-06 Thread [EMAIL PROTECTED]

one solution to the unwieldy dropdown is to use raw_id_admin=True
option for the ForeignKey. Documentation on
http://www.djangoproject.com/documentation/model_api/#many-to-one-relationships

for collapsing the children, I'm not sure exacly what you mean, but in
the Admin inner-class for the model, you can put the field in it's own
section and apply the "collapse" html class. Documentation here:
http://www.djangoproject.com/documentation/tutorial2/  (search for
"collapse")


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



Session get_decoded

2006-09-06 Thread mrstone

  File
"/usr/local/lib/python2.4/site-packages/django/contrib/sessions/middleware.py",
line 57, in _get_session
self._session_cache = s.get_decoded()

  File
"/usr/local/lib/python2.4/site-packages/django/contrib/sessions/models.py",
line 61, in get_decoded
encoded_data = base64.decodestring(self.session_data)

  File "/usr/local/lib/python2.4/base64.py", line 319, in decodestring
return binascii.a2b_base64(s)

TypeError: a2b_base64() argument 1 must be string or read-only
character buffer, not array.array



I get the following error when trying to move my project to another
server. I have pinned it down to the Mysql installation. Anyone seen
this and can hint in any direction?

Regards
Sten


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



Problem / misunderstanding / limitation in admin interface? (0.95)

2006-09-06 Thread Scott Finnie

Have created model (below) which doesn't report any errors in admin, but 
unfortunately doesn't work either.  Behaviour as follows:

1. Create instance of Server in admin;
2. Populate core server fields;
3. Create a couple of Product Deployments;
4. Save

On returning to edit the server, the core server details are correct - 
but none of the deployments has been recorded.  Examining the db shows 
no entries in the intersection table used to record the m2m mapping.

Tried from the shell and all works OK - as long as the Deployment 
instance is saved before the m2m mapping instances are added. 
Otherwise, there's an exception.

Would appreciate any help; e.g. is this a valid use of the admin 
interface?  (From the shell trace it looks like the Deployment has to be 
saved before adding the referenced packages, maybe admin doesn't do this?)

Thanks,
Scoot.
--
model.py

"""
Simple model for recording inventory of systems deployed.
ProductVersion is specification class describing the products that can 
be deployed; Servers are the physical hosts; PackageDeployments map 
software packages (instances of ProductVersion) to the Servers on which 
they're deployed (M2M).
"""
from django.db import models

PRODUCT_TYPE = (
 ('hw', 'Hardware'),
 ('os', 'Operating System'),
 ('pkg', 'Application Package')
)

ENVIRONMENT = (
 ('prod', 'Production'),
 ('ppd', 'Pre-production'),
 ('test', 'Test'),
 ('dev', 'Development')
)

class ProductVersion(models.Model):
 """Describes prducts: hardware models, operating systems,
software packages.  """
 class Admin:
 list_display=('name',)
 search_fields = ('name',)
 ordering = ('name',)

 name = models.CharField("Name", maxlength=100, core=True)
 pvtype = models.CharField("Type", maxlength=100,
   core=True, choices=PRODUCT_TYPE)

 def __str__(self):
 return self.name

class Server(models.Model):
 """A server hosting various software packages"""
 class Admin:
 list_display=('name', 'mdl', 'os',)
 search_fields = ('name',)
 ordering = ('name',)
 fields = (
 (None, {'fields': ('name', 'mdl', 'os',)}),
 )

 name = models.CharField("Name", maxlength=100, core=True)
 mdl  = models.ForeignKey(ProductVersion,
  verbose_name="model",
  related_name="modelOf",
  limit_choices_to = {'pvtype__exact' : "hw"},
  core=True)
 os   = models.ForeignKey(ProductVersion,
  verbose_name="Operating System",
  related_name="osOn",
  limit_choices_to = {'pvtype__exact' : "os"},
  core=True)
 def __str__(self):
 return(self.name)

class PackageDeployment(models.Model):
 """ Represents deployment of a set of software packages on a server
 """
 description   = models.CharField("Description", maxlength=100,
  core=True, blank=True, null=True)
 environment   = models.CharField("Environment", maxlength=100,
  core=True, choices=ENVIRONMENT)
 server= models.ForeignKey(Server,
   edit_inline=models.TABULAR,
   num_in_admin=3,
   verbose_name="Server",
   related_name="hostFor",
   core=True)
 packages  = models.ManyToManyField(ProductVersion,
   verbose_name="Packages",
   related_name="deployedOn",
   limit_choices_to = 
{'pvtype__exact' : "pkg"},
   core=True)

 def __str__(self):
 return self.server.name + "-" + self.environment
--
Shell trace
---
 >>> from scratch1.scratchapp.models import *
 >>> hwmdl=ProductVersion(name="Server Model", pvtype="hw")
 >>> hwmdl.save()
 >>> osmdl=ProductVersion(name="linux", pvtype="os")
 >>> osmdl.save()
 >>> pkg1=ProductVersion(name="Package 1", pvtype="pkg")
 >>> pkg1.save()
 >>> pkg2=ProductVersion(name="Package 2", pvtype="pkg")
 >>> pkg2.save()
 >>> pkg3=ProductVersion(name="Package 3", pvtype="pkg")
 >>> pkg3.save()
 >>> srvr=Server(name="Server 1", mdl=hwmdl, os=osmdl)
 >>> srvr.save()
 >>> pd1=PackageDeployment(environment='ppd', server=srvr)

 >>> # save before adding referenced packages: success

 >>> pd1.save()
 >>> pd1.packages.add(pkg1, pkg2)
 >>> pd1.save()
 >>> pd1.packages.all()
[, ]

 >>> # no save before adding referenced packages: fails
 >>> # error msg indicates problem with ProductVersion pk,
 >>> # not sure why...

 >>> 

Re: Diamanda Wiki and MyghtyBoard Forum on SVN now

2006-09-06 Thread [EMAIL PROTECTED]

extra markups could be probably used. I've didn't use markdown or
textile as they don't realy offer a full markup set for documents (and
they "destroy" ContentBBcode or its output. I'll probably add some
basic wiki syntax for formating but it won't substitute HTML.


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



tumblelogs

2006-09-06 Thread kwe

Hi all,
All the kool kids seem to have tumbelog sections these days - i.e.
rolling records of changes to the various data types on the site. Is
there some specific 'magic' to these e.g. using signals or some such
django feature?


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



Re: Ordering with get_profile/AUTH_PROFILE_MODULE

2006-09-06 Thread Jay Parlar

Ahh, thanks for the effort guys. The select_related() and the dots are
what made it work:

UserProfile.objects.filter(board_member=True).select_related().order_by('auth_user.last_name')

Jay P.

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



Re: Programtically changing templates the "Django way"

2006-09-06 Thread Adrian Holovaty

On 9/6/06, Adam Mikeal <[EMAIL PROTECTED]> wrote:
> Hmm. Perhaps it is the base.html that should change for each template,
> and the other pages should remain common... that *might* work. But then
> the problem would be how to reference the correct base_xxx.html file -
> can I change that parameter with a variable (the paramter to the
> template "extends" tag)?

Yes, the "extends" tag can take a variable.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

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



Re: Dojo Editor2 invocation from Django

2006-09-06 Thread Gloria

Thank you for your responses. The steps Patrickk lists are repretitive,
just like the ones listed in the link I had referenced, except #4 and
the comment below it. Those were helpful, thank you.

Re: The bugs in the Dojo Editor2: Are they so serious that you would
not consider fixing them if you were a rich text javascript developer,
looking for an editor to incorporate into your product?

Re: FckEditor: Is it mature enough to be used in a product? Do any
products currently use it? Isn't it easy to remap the key sequences for
break vs. paragraph? Or is this deeply embedded in the code for some
reason?

Re: TinyMce: I hear great things about this editor, but not from
developers. I need to be able to customize the editor I ultimately
choose. I hear it's not as mature as the Dojo editor. Is this true?

Should this be taken offline, because it's tangential to Django? Or
should it be left here for others looking to integrate rich text
editing?


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



Re: Ordering with get_profile/AUTH_PROFILE_MODULE

2006-09-06 Thread Jay Parlar

On 9/6/06, James Bennett <[EMAIL PROTECTED]> wrote:
> What happens when you instead do
>
> UserProfile.objects.filter(board_member=True).order_by('user__last_name') ?
>
> (and maybe make sure you slap a 'select_related' in before that order_by)
>

I tried: 
UserProfile.objects.filter(board_member=True).order_by('user__last_name')
 and I also tried
UserProfile.objects.select_related().filter(board_member=True).order_by('user__last_name'),
and they both gave me:

OperationalError: (1054, "Unknown column
'members_userprofile.user__last_name' in 'order clause'")

BTW, this is with MySQL.

Jay P.

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



Re: Ordering with get_profile/AUTH_PROFILE_MODULE

2006-09-06 Thread Malcolm Tredinnick

On Wed, 2006-09-06 at 15:20 -0400, Jay Parlar wrote:
> On 9/6/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> > > On Wed, 2006-09-06 at 14:28 -0400, Jay Parlar wrote:
> > > So to fix this, I tried going the other direction, by filtering on
> > > UserProfile, and then ordering the results on User, doing this:
> > >
> > > UserProfile.objects.filter(board_member=True).order_by('auth_user.last_name')
> > >
> > > but I get this:
> > >
> > > OperationalError: (1054, "Unknown column 'auth_user.last_name' in
> > > 'order clause'")
> >
> > Why isn't this order_by('user.last_name'), since the name of the
> > attribute in UserProfile is 'user'? Is this just a typo?
> >
> 
> I was going by the db_api documentation, ie:
> 
> To order by a field in a different table, add the other table's name
> and a dot, like so:
> Entry.objects.order_by('blogs_blog.name', 'headline')
> 
> 
> Changing it to 'user.last_name' doesn't work either though.

OK, so James just reminded me that this is ticket #2076 rearing its ugly
head again. Which means it's being fixed as part of the query rewrite
stuff.

Malcolm



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



Re: Re: Re: Ordering with get_profile/AUTH_PROFILE_MODULE

2006-09-06 Thread James Bennett

On 9/6/06, James Bennett <[EMAIL PROTECTED]> wrote:
> What happens when you put 'select_related()' before the order_by?

And for the record, I ask because that's the workaround suggested
until ticket #2076[1] (which I think is the root of this problem) is
fixed. If that doesn't work, we probably need to know about it.

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

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

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



Re: Programtically changing templates the "Django way"

2006-09-06 Thread Rob Hudson

Adam Mikeal wrote:
> So, how can I alter/change the html for each different conference
> without either rewriting all of those "content" templates each time, or
> requiring a bunch of include statements in every template? Also, I
> don't want to have 20 template pages for each conference, when only the
> common elements are changing...

Could you push those display changes into CSS?

For example, in your detail template wrap the whole thing with a div tag:





Then let CSS selectors change the display:

#roomABC #content1 { /* CSS here */ }
#roomXYZ #content1 { /* Other CSS here */ }

I'm doing something similar in a project I'm working on.

Alternatively just check the room variable if you have one and wrap it 
in a conditional using the Django template syntax:

{% ifequal conference_room "ABC" %}

{% endifequal %}
etc.

Just some ideas.

-Rob

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



Re: Programtically changing templates the "Django way"

2006-09-06 Thread Adam Mikeal


Jeremy Dunck wrote:
> It sounds like you want your template name to be a field on the
> conference model.

Exactly. This was my first thought. However, here's the problem: the
templates currently extend a base template to add in the forms and data
for the registration stuff into a main content block:

 + base.html
   --- conference_register.html
   --- conference_detail.html
  ...


So, how can I alter/change the html for each different conference
without either rewriting all of those "content" templates each time, or
requiring a bunch of include statements in every template? Also, I
don't want to have 20 template pages for each conference, when only the
common elements are changing...

Hmm. Perhaps it is the base.html that should change for each template,
and the other pages should remain common... that *might* work. But then
the problem would be how to reference the correct base_xxx.html file -
can I change that parameter with a variable (the paramter to the
template "extends" tag)?


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



Re: Ordering with get_profile/AUTH_PROFILE_MODULE

2006-09-06 Thread Jay Parlar

On 9/6/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> > On Wed, 2006-09-06 at 14:28 -0400, Jay Parlar wrote:
> > So to fix this, I tried going the other direction, by filtering on
> > UserProfile, and then ordering the results on User, doing this:
> >
> > UserProfile.objects.filter(board_member=True).order_by('auth_user.last_name')
> >
> > but I get this:
> >
> > OperationalError: (1054, "Unknown column 'auth_user.last_name' in
> > 'order clause'")
>
> Why isn't this order_by('user.last_name'), since the name of the
> attribute in UserProfile is 'user'? Is this just a typo?
>

I was going by the db_api documentation, ie:

To order by a field in a different table, add the other table's name
and a dot, like so:
Entry.objects.order_by('blogs_blog.name', 'headline')


Changing it to 'user.last_name' doesn't work either though.

Jay P.

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



Re: Ordering with get_profile/AUTH_PROFILE_MODULE

2006-09-06 Thread James Bennett

On 9/6/06, Jay Parlar <[EMAIL PROTECTED]> wrote:
> So to fix this, I tried going the other direction, by filtering on
> UserProfile, and then ordering the results on User, doing this:
>
> UserProfile.objects.filter(board_member=True).order_by('auth_user.last_name')

What happens when you instead do

UserProfile.objects.filter(board_member=True).order_by('user__last_name') ?

(and maybe make sure you slap a 'select_related' in before that order_by)

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

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



Re: archive_index returns no results

2006-09-06 Thread hotani

thanks, right - that was obvious and I overlooked it, not my first
time...


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



Re: archive_index returns no results

2006-09-06 Thread James Bennett

On 9/6/06, hotani <[EMAIL PROTECTED]> wrote:
> in the template, I'm testing for object list like so:
> {% if object_list %}
>
> also tried putting {% if archive_index %} but that sees nothing as well.

As the documentation[1] points out, the archive_index view gives you a
variable called 'latest', not 'object_list' (because the purpose of
archive_index is to show the latest content for a given model).

[1] 
http://www.djangoproject.com/documentation/generic_views/#django-views-generic-date-based-archive-index

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

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



Ordering with get_profile/AUTH_PROFILE_MODULE

2006-09-06 Thread Jay Parlar

Following James' tutorial
(http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model)
I created a UserProfile model, that is essentially:

class UserProfile(models.Model):
board_member = models.BooleanField()
user = models.OneToOneField(User)


What I want is a list of Users, ordered by last_name, filtering on
board_member=True.

I tried this:

User.objects.filter(get_profile__board_member=True), but this gives
the following:

TypeError: Cannot resolve keyword 'get_profile' into field


So I'm guessing that the filter syntax can't handle methods, just
attribute fields.

So to fix this, I tried going the other direction, by filtering on
UserProfile, and then ordering the results on User, doing this:

UserProfile.objects.filter(board_member=True).order_by('auth_user.last_name')

but I get this:

OperationalError: (1054, "Unknown column 'auth_user.last_name' in
'order clause'")

Any thoughts on this? Is this simply not possible with
get_profile/AUTH_PROFILE_MODULE

Thanks,
Jay P.

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



archive_index returns no results

2006-09-06 Thread hotani

I'm trying to display the most recently closed bugs in a bug tracker by
using the archive_index generic view, but no matter what, it will not
return any results.

this is from urls:
recent_dict = {
'template_name': 'recent.html',
'date_field': 'last_mod',
'num_latest': '20',
'queryset': Bug.objects.all(),
}

and:
#   view 20 most recently closed issues:
(r'^recent/$', 'django.views.generic.date_based.archive_index',
recent_dict),


In the example above, I'm not restricting to closed issues - just
trying to display anything but am getting nothing. The standard list
view page shows all and is working normally. Here is the code for that:

info_dict = {
'queryset': Bug.objects.all(),
'paginate_by': 30,
}

#   Search Bugs/List view:
(r'^$', 'project.bugs.views.object_list'),


in the template, I'm testing for object list like so:
{% if object_list %}

also tried putting {% if archive_index %} but that sees nothing as well.


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



Re: my private django repository goes public

2006-09-06 Thread dummy

Hi Max,

garaged schrieb:
> On 8/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> for svn checkout or export the correct trunk-url is
>> http://svn.sourceforge.net/svnroot/django-userlibs/trunk
>>
>
> Probably I need to install it with setup.py, but I don't know for sure.
>
> Can you give us a hint on this ??
>
> Max
>

I added some hints on the README.txt for 
http://svn.sourceforge.net/svnroot/django-userlibs/trunk/libs.common

Yes, you install it view setup.py build/install/bdist_rpm like django.

Regards,
Dirk
-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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



Handling data from multiple checkboxes for a single field

2006-09-06 Thread mthorley

Greetings, I'm working on a custom field that uses multiple checkboxes
similar to CheckboxSelectMultipleField. The problem I am having is how
to get the data back from all the check boxes so that I can validate it
and save it as a single integer.

I read this post
http://groups.google.com/group/django-users/browse_frm/thread/d9d771e72c09d053/58e1d47fa89df4ea#58e1d47fa89df4ea
where the solution is to call field.prepare explicitly in the view, but
that is not what I want.

I believe the problem to be the fact that the name and id of the
checkbox elements in the rendered html to not exactly match the name of
my field. (This is becase each checkbox must have a different name, so
I named them fieldName + indexNum.) So when the form is submitted and
the POSTed data is picked up by Manipulator, it passes None to my
fields prepare method.

Is there a way to declare that my field uses a custom manipulator? Is
there another way this is supposed to be done? I don't want to have to
do magic in my views to make this work.


Thanks much folks. I welcome any and all comments, especially if you no
a better, or 'right' way to do this.
--
mthorley


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



Re: Programtically changing templates the "Django way"

2006-09-06 Thread Jeremy Dunck

On 9/6/06, Adam Mikeal <[EMAIL PROTECTED]> wrote:
> http://conferences.tamu.edu/OR07/
...
> once you navigate "one layer down", into a specific conference, you
> will see a different look-and-feel, as determined by an HTML template.

It sounds like you want your template name to be a field on the
conference model.

class Conference(Model):
  slug =...#OR07...
  template = ...#conference/ORConferences

Or somesuch.

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



Re: Need Template Tag help - I'm making this harder than it has to be.

2006-09-06 Thread [EMAIL PROTECTED]

Sorry for the confusion. I try to be clear, but obviously sometimes
leave out some critical info. I've read and re-read the db-api
document, yet I just couldn't get this to work, at least not the way I
wanted it to.

Here's what I ended up with. It's still not pretty, and I'm sure folks
will have ideas on how I can clean it up, but it works:

class SponsorsListNode(template.Node):
def __init__(self, section, varname):
self.section = section
self.varname = varname
self.sect = Section.objects.filter(section=self.section)[0]
self.sponsors = self.sect.sponsor.all()

def __repr__(self):
return ""

def render(self, context):
context[self.varname] = self.sponsors.order_by('?')
return ''

Thanks everyone for helping me find the path!


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



Re: CheckboxSelectMultipleField problem

2006-09-06 Thread mthorley

Thanks Guille, that looks like it will do what I want, but I just
realized I have another, different, problem.

--
mthorley


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



Programtically changing templates the "Django way"

2006-09-06 Thread Adam Mikeal

I need some help with how to approach a particular problem. I am new to
Django (but not to web application development), and while I can think
of several ways to solve this problem, I wanted to get some input from
the Django community as to the "correct", or most "Django" way to solve
it.

Here's the situation: I have created a conference registration system
that will be able to handle people management and registration for
multiple conferences; access to each conference is dictated by the URL,
like so:

http://conferences.tamu.edu/OR07/
http://conferences.tamu.edu/ABC08/
http://conferences.tamu.edu/XYZ07/

Currently there is only once conference active. The goal is to allow
for a base HTML template that is shown at conference.tamu.edu, and that
once you navigate "one layer down", into a specific conference, you
will see a different look-and-feel, as determined by an HTML template.


Since the main data will not change (and it fairly generic), I was
thinking of having defined "snippets" of HTML, like a header, footer,
sidebar, etc, that would be replaceable. Of course, an alternative
method (like actual template files) would be acceptable, too.

Here are some additional constraints:

  + Ideally, I would like the template changes to be optional; that is,
if there is no file that defines a special header (or footer, etc),
then the default header (or footer, etc) is used.
  + Also, it would be best if the HTML snippets that defined the
special look and feel could be editable through the Admin interface,
and not only through the filesystem (I don't want to give filesystem
access to the users managing the conferences).
  + Lastly, it would be cool if a URL could be provided that returned
the HTML snippet for the particular section, rather than just storing
HTML directly (this is the most expendable item).

So, any suggestions? Thanks in advance for the input...


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



Re: {% include %}'d files not interpolating {% block %}s?

2006-09-06 Thread Rob Hudson

Cole Tuininga wrote:
> Fair enough.  Is there a better way to accomplish this?  I'd much
> prefer to have the title defined within the template rather than
> having to pass it in as a variable from the view...

I think you just have to think about it the other way around.  Instead
of each template including bits of other templates you have a base
template that defines all the bits, and each template extends from the
base and specifies what each of the bits are (or doesn't specify them
if you want the default).

So you original example might be something like this:



{% block head %}

{% endblock %}


{% block header %}{% endblock %}
{% block menu %}{% endblock %}
{% block content %}{% endblock %}



I'm even adding things like this:



So if I want or need to add a declaration to body in a subtemplate, I
add an extra block with its content.  And if I don't, I get a plain
body tag.

-Rob


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



Re: Calling a view from another view in the same app?

2006-09-06 Thread Facundo Casco
Alan Green wrote:
> Hi Facundo,
>
> Nope the problem's not in that code. The stack trace will tell you the
> method with the problem.
>
> Just in case you didn't know, UnboundLocalError is a Python error that
> you get when a method refers to a variable before assigning it a
> value. For example:
>
>   
 def f():
 
> ...   print q
> ...   q = 2
> ...   
>   
 f()
 
> Traceback (most recent call last):
>   File "", line 1, in ?
>   File "", line 2, in f
> UnboundLocalError: local variable 'q' referenced before assignment
>   
>
> Hope that helps. If not, please post the full stack trace of the error.
>
> Alan.
>   

Alan, thanks for your help. This is the complete error reported by Django:
|Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in
get_response
  74. response = callback(request, *callback_args, **callback_kwargs)
File "/home/facundo/amxdev/contable/views.py" in viajes
  484. resp = viaje(request)

  UnboundLocalError at /adm/viaj/
  local variable 'viaje' referenced before assignment

'viaje' should be referencing the method defined before, not a variable.
As you can see, the code should be in views.py line 484

I've tried changing that line to:
resp = amxdev.contable.views.viaje(request)

and now it works. I though that Python would look in the same file for
definitions, actually in other app's models file I define a function at
the end of the file and use it in the middle inside some class' method
without any problems.
Anyway, thanks again for your time and help.

Regards.

Facundo
|
>
> On 9/6/06, Facundo Casco <[EMAIL PROTECTED]> wrote:
>   
  UnboundLocalError at /adm/viaj/
local variable 'viaje' referenced before assignment

 
>>> You have an assignment to a local variable named 'viaje', but you are
>>> using the name 'viaje' before that assignment. Look for a line that
>>> begins "viaje =".  It's best not to have variables and functions with
>>> the same name.
>>>
>>> If you're still having trouble, please post the last ten or fifteen
>>> lines of the stacktrace, plus the complete code for the function with
>>> the UnboundLocalError, and someone will be able to pinpoint the
>>> problem for you.
>>>
>>> Regards,
>>>
>>> Alan.
>>>
>>>   
>> Thanks for your help, this is the code, what I want to do is call the
>> function viaje defined before. I can use that same function if I call it
>> from my urls.py but it doesn't work from the views.py file.
>>
>> def viaje(request, numero=None):
>> +-- 37 lines: "Genera un informe detallado de un viaje"-
>>
>> def viajes(request):
>>"Genera listados de viajes por distintos criterios"
>>clie = 'Todos'
>>prov = 'Todos'
>>desde = 'Sin limite'
>>hasta = 'Sin limite'
>>paxs = 'Todos'
>>viajes = amxdev.vtour.models.viaje().getAllObjects()
>>if request.GET['numero'] != '':
>>   resp = viaje(request)
>>   return resp
>>
>> Facundo
>>
>>
>> 
>> 
>
>
>   

-- 
AMV Multiviajes Argentina
Esmeralda 847 Piso 12 Of. 'G'
C1007ABI - Buenos Aires
Argentina
Tel: +54 11 5031-3060 / 3061
Fax: +54 11 4313-6141



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---
begin:vcard
fn:Facundo Casco
n:Casco;Facundo
org:AMV Multiviajes Argentina S.R.L.
adr:Piso 12 Oficina 'G';;Esmeralda 847;Buenos Aires;CF;C1007ABI;Argentina
email;internet:[EMAIL PROTECTED]
tel;work:+54 11 5031-3060 / 3061
tel;fax:+54 11 4313-6141
url:http://www.multiviajesar.com.ar
version:2.1
end:vcard



Re: Need Template Tag help - I'm making this harder than it has to be.

2006-09-06 Thread limodou

On 9/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> To clarify, in my model, I've established ManyToMany relationship
> between Sponsor and Section, and all I want to do is return a list of
> sponsors where section = x
>
But you didn't describe what are your models like. So I don't know
there is a manytomany relationship between section and sponsors.

If there are manytomany relationship between section and sponsors, so
you could try:

section.sponsor_set.all()

And this is described in db-api document.

-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad

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



Re: Need Template Tag help - I'm making this harder than it has to be.

2006-09-06 Thread [EMAIL PROTECTED]

To clarify, in my model, I've established ManyToMany relationship
between Sponsor and Section, and all I want to do is return a list of
sponsors where section = x


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



Still unclear about image urls in a template

2006-09-06 Thread keukaman

I'm still a bit unclear about the best way to refer to images in a
template. My server settings are written so that Django doesn't serve
the image directly. I have a subdomain to manage my media.

I refer to my logo in my site like this:

http://media.mysitename.com/img/logo.gif;>

It seems that it may not be the best practice to have more http://
calls than is absolutely necessary in a file.

Is there a better way to do this?


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



Re: Need Template Tag help - I'm making this harder than it has to be.

2006-09-06 Thread [EMAIL PROTECTED]

If there's a many to many relationship, shouldn't section already be
aware of the child sponsors?


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



Re: Need Template Tag help - I'm making this harder than it has to be.

2006-09-06 Thread limodou

On 9/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Well crap... so I'm stuck.
>
> I pass the section when I call the template tag.
> I can match the section (because I only want the sponsors for that
> section) and get the appropriate section object
> But I can't pass the child sponsors of the object back to the page?
>
>
Why not write a custom function in model to return the child sponsors?
So you can get the child sponsors through the section object.

-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad

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



Re: Need Template Tag help - I'm making this harder than it has to be.

2006-09-06 Thread [EMAIL PROTECTED]

Well crap... so I'm stuck.

I pass the section when I call the template tag.
I can match the section (because I only want the sponsors for that
section) and get the appropriate section object
But I can't pass the child sponsors of the object back to the page?


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



Re: Generic views table sort

2006-09-06 Thread Robert

Hello Aidas,

I will try to implement
your view :)

As for pagination, I've found
a great templatetag at:

http://code.djangoproject.com/wiki/CookBookTemplateTags

Thanks,
Robert


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



Re: Filter question

2006-09-06 Thread primitive

Thanks a lot guys :-), this works great. (Both suggestions from Dave
and Russ), so elegant : - ). Thanks a million!


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



Re: Diamanda Wiki and MyghtyBoard Forum on SVN now

2006-09-06 Thread limodou

Can Diamanda support moin text format, I don't like the text format
shipped with Diamanda. Can the page support multi text format?

-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad

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



Re: Need Template Tag help - I'm making this harder than it has to be.

2006-09-06 Thread limodou

On 9/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Thanks! That definitely gets the object. I tried to get the child
> sponsor for that section several different ways, but keep running into
> a "Manager isn't accessible via Section instance" errror.
>
Yeah. Only the model class has a Manager instance, model instance
hasnot this instance.

-- 
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad

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



Re: Advanced Admin Customization

2006-09-06 Thread Chris Long

Either that, or use a custom manipulator and override the save method
there. Depends on if the processing will always need to be done when
saving or just done with the form data. If it's the form data, probably
best to put it in a manipulator. If you want, just create a manipulator
and override it in the model, and only override the save method of the
manipulator, the rest can probably be normal.

Chris


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



Re: add/edit/delete for users and login functionality

2006-09-06 Thread [EMAIL PROTECTED]

What kind of problem? I did an app using customized admin pages and
granted only add/modify rights to users. It is indeed for internal use,
but I got concerned abou 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
-~--~~~~--~~--~--~---



Re: WebServices datasource

2006-09-06 Thread Bill de hÓra

Marc Fargas wrote:
> Hi,
> In reference to [1], what would be the best way to provide a
> datasource for a model that is backed on a WebService ?
> 
> Image you have a webservice that returns "customer objects", then I'd
> like to have a model called Customer on which to use .objects.all()
> and so. So, how should I build that model so it has  all the nice
> model methods backed on a webservice ? (WSDL, SOAP)

Putting all those customer domain things behind a single URL will lead 
to pain.

Give each customer its own URL and set up an RSS/Atom feed for customer 
objects; let the feed act as the service endpoint.

cheers
Bill




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



Re: changeManipulator and edit_inline

2006-09-06 Thread can.xiang

Sorry, I was reply your post in browser and google kept telling me
there was an error for my post action. I tried several time, so...


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



Re: changeManipulator and edit_inline

2006-09-06 Thread can.xiang

My understanding about ChangeManipulator is it should be only used for
one model and it's ok with another model with edit-inline.

If you'd like to manipulate two model at the same time without
edit-inline, you can either subclass the Manipulator instead of
ChangeManipulator or use two ChangeManipulator.

If you have no special requirement for the edit-inline model, go ahead
use one ChangeManipulator. Below is a example:

model2 is edit-inline into model

In view:

# use one ChangeManipulator
m= model.ChangeManipulator()
# MUST DO, both edit-inline object and model object populated in
new_data
new_data=m.flatten_data()
form = forms.FormWrapper(m, new_data, errors)

In template, access the edit-inline formfield with:

{% for model2item in form.model2 %}
{{ model2item.field }}
...
{% endfor %}

Soon or later you'll find it's painful to dealwith the field size of
the edit-inline field. I made a template filter to resize the
formfield. Please take a look at code in the link below(forgive me,
it's a chinese blog entry):

http://blog.xiangcan.com/blog/me/2006/09/06/28.html


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



Re: changeManipulator and edit_inline

2006-09-06 Thread can.xiang

My understanding about ChangeManipulator is it should be only used for
one model and it's ok with another model with edit-inline.

If you'd like to manipulate two model at the same time without
edit-inline, you can either subclass the Manipulator instead of
ChangeManipulator or use two ChangeManipulator.

If you have no special requirement for the edit-inline model, go ahead
use one ChangeManipulator. Below is a example:

model2 is edit-inline into model

In view:

# use one ChangeManipulator
m= model.ChangeManipulator()
# MUST DO, both edit-inline object and model object populated in
new_data
new_data=m.flatten_data()
form = forms.FormWrapper(m, new_data, errors)

In template, access the edit-inline formfield with:

{% for model2item in form.model2 %}
{{ model2item.field }}
...
{% endfor %}

Soon or later you'll find it's painful to dealwith the field size of
the edit-inline field. I made a template filter to resize the
formfield. Please take a look at code in the link below(forgive me,
it's a chinese blog entry):

http://blog.xiangcan.com/blog/me/2006/09/06/28.html


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



Re: changeManipulator and edit_inline

2006-09-06 Thread can.xiang

My understanding about ChangeManipulator is it should be only used for
one model and it's ok with another model with edit-inline.

If you'd like to manipulate two model at the same time without
edit-inline, you can either subclass the Manipulator instead of
ChangeManipulator or use two ChangeManipulator.

If you have no special requirement for the edit-inline model, go ahead
use one ChangeManipulator. Below is a example:

model2 is edit-inline into model

In view:

# use one ChangeManipulator
m= model.ChangeManipulator()
# MUST DO, both edit-inline object and model object populated in
new_data
new_data=m.flatten_data()
form = forms.FormWrapper(m, new_data, errors)

In template, access the edit-inline formfield with:

{% for model2item in form.model2 %}
{{ model2item.field }}
...
{% endfor %}

Soon or later you'll find it's painful to dealwith the field size of
the edit-inline field. I made a template filter to resize the
formfield. Please take a look at code in the link below(forgive me,
it's a chinese blog entry):

http://blog.xiangcan.com/blog/me/2006/09/06/28.html


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



Re: changeManipulator and edit_inline

2006-09-06 Thread can.xiang

My understanding about ChangeManipulator is it should be only used for
one model and it's ok with another model with edit-inline.

If you'd like to manipulate two model at the same time without
edit-inline, you can either subclass the Manipulator instead of
ChangeManipulator or use two ChangeManipulator.

If you have no special requirement for the edit-inline model, go ahead
use one ChangeManipulator. Below is a example:

model2 is edit-inline into model

In view:

# use one ChangeManipulator
m= model.ChangeManipulator()
# MUST DO, both edit-inline object and model object populated in
new_data
new_data=m.flatten_data()
form = forms.FormWrapper(m, new_data, errors)

In template, access the edit-inline formfield with:

{% for model2item in form.model2 %}
{{ model2item.field }}
...
{% endfor %}

Soon or later you'll find it's painful to dealwith the field size of
the edit-inline field. I made a template filter to resize the
formfield. Please take a look at code in the link below(forgive me,
it's a chinese blog entry):

http://blog.xiangcan.com/blog/me/2006/09/06/28.html


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



Re: Strange socket problem

2006-09-06 Thread Jay Parlar

On 9/5/06, limodou <[EMAIL PROTECTED]> wrote:
> Sometimes I only view the pages in dev server, but this information
> also occurs. I remeber there is no this error before, I don't know
> why? Do you know how to resove it?
>

No clue how to solve it. I haven't worried much about it, because it
doesn't hinder my development. And everything works ok once I've
deployed with Apache.

Jay P.

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



Re: Need Template Tag help - I'm making this harder than it has to be.

2006-09-06 Thread [EMAIL PROTECTED]

Thanks! That definitely gets the object. I tried to get the child
sponsor for that section several different ways, but keep running into
a "Manager isn't accessible via Section instance" errror.


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



Re: How to correct this error?

2006-09-06 Thread PythonistL

Hello Corey,
Thank you for your reply.
I do not like PHP and  I prefer comand line.
So, after some testing I finally found out the command
ALTER TABLE `tablename ` CHANGE `fieldname` `fieldname` VARCHAR( 10 )
CHARACTER SET utf8 COLLATE utf8_czech_ci.

Regards,
L.


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



Re: How to correct this error?

2006-09-06 Thread Corey Oordt

Believe it or not, latin1_swedish_ci is a default collation for MySQL.

I recommend using PHPMyAdmin. It is the easiest way to see the  
collations and change the collations. (but you have to use PHP :( )

You can use the MySQL Administrator GUI but it is a pain as you have  
to do a lot more clicking to get into the tables and see the collations.

I don't know how to do it from the command line, as I have always  
used PHPMyAdmin to do it.

Wish I could be of more help,

Corey

On Sep 6, 2006, at 4:16 AM, PythonistL wrote:

>
> Corey,
> Thank you for your reply.
> The exception Value
>
> (1267, "Illegal mix of collations (utf8_czech_ci,IMPLICIT) and
> (latin1_swedish_ci,COERCIBLE) for operation '='")
>
>
> is from this  command:
> gallerys.get_list(Title__exact=new_data['Title'])
> So, I would guess that Title field or new_data['Title']  has
> (latin1_swedish_ci,COERCIBLE) collation.
> But how can I find out  which one is of (latin1_swedish_ci,COERCIBLE)
> collation?
>
> Thank you for the reply
> L.
>
>
> >


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



Re: Diamanda Wiki and MyghtyBoard Forum on SVN now

2006-09-06 Thread [EMAIL PROTECTED]


ptree wrote:
> Great work.
>
> There are some absolute filepaths used in views can be replaced with
> settings.SITE_IMAGES_DIR_PATH
>
> im.save("home/../../bg2.jpg',"JPEG")
>
> im.save(settings.SITE_IMAGES_DIR_PATH+'/bg2.jpg',"JPEG")
Ups, forgot, that :) will be fixed in few minuts :)

> It would be better if prepare some initial  data for  test,it puzzles
> me some while when i can't add a new page since there no "categories"
> to choose
there are extra SQL files with initial data but they currently seem to
work only on MySQL. I'll make them DB specific or I'll try to add them
via the diango ORM :)


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



Re: Dojo Editor2 invocation from Django

2006-09-06 Thread patrickk

some points on using the dojoeditor:
1. right now, I don´t recommend it (there´s a new editor2 with lots  
of bugs)
2. with fckeditor, it´s very easy to connect your own scripts (e.g.  
your own file uploader) - but there´s still the whole "paragraph-vs- 
break"-issue when using enter.
3. tinymce is much cleaner with using paragraphs all over (but i´m  
not sure how hard it is to customize tinymce)

about integrating dojo:
1. download dojo and save it to /media/dojo/...
2. copy the script from the site and save it (e.g. /media/js/admin/ 
AddRichTextEditing.js)
3. in the admin-section of your model, write: js = ('js/admin/ 
AddRichTextEditing.js')
4. every text-field that should have RTE must have "help_text='Rich  
Text Editing.'"

to answer your question: you don´t need the view to use this.

hope that helps,
patrick

Am 06.09.2006 um 03:40 schrieb Gloria:

>
> Hi there. I found this nifty when I searched for Django and Dojo:
>
> http://code.djangoproject.com/wiki/AddDojoEditor
>
> The thread on this link is closed, so I am starting a new one.
>
> Please explain how I invoke this code. I am fairly new to Django, and
> I've avoided javascript like the plague over the years, but I
> understand the constructs.
>
> This example explains the model and the media interface. But how do I
> invoke this piece of js code from within my view?
>
> Thanks for tolerating neophyte questions here.
>
> Gloria
>
>
> >


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



Re: Dojo Editor2 invocation from Django

2006-09-06 Thread Gábor Farkas

Gloria wrote:
> Hi there. I found this nifty when I searched for Django and Dojo:
> 
> http://code.djangoproject.com/wiki/AddDojoEditor
> 
> The thread on this link is closed, so I am starting a new one.
> 
> Please explain how I invoke this code. I am fairly new to Django, and
> I've avoided javascript like the plague over the years, but I
> understand the constructs.
> 
> This example explains the model and the media interface. But how do I
> invoke this piece of js code from within my view?
> 
> Thanks for tolerating neophyte questions here.
> 

hi,

that webpage is explaining how to add Editor2 to the 
django-admin-application (the one that's usuallay at http://foo.com/admin).

if you want to add it to your own code,
then simply read the documentation on the dojo 'side', and act accordingly.

it does not have to do anything with django.

for example, simply adjust your html-template to be suitable for the 
Editor2 widget, and all should work. no changes to the django-views 
should be necessary.

if it does not work, just come back here, show us the non-working code, 
and we'll help (if we can) :)


gabor

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



Re: How to correct this error?

2006-09-06 Thread PythonistL

Corey,
Thank you for your reply.
The exception Value

(1267, "Illegal mix of collations (utf8_czech_ci,IMPLICIT) and
(latin1_swedish_ci,COERCIBLE) for operation '='")


is from this  command:
gallerys.get_list(Title__exact=new_data['Title'])
So, I would guess that Title field or new_data['Title']  has
(latin1_swedish_ci,COERCIBLE) collation.
But how can I find out  which one is of (latin1_swedish_ci,COERCIBLE)
collation? 

Thank you for the reply 
L.


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



Re: Restrict amount of text in a TextField form

2006-09-06 Thread cyberco

Thanks for the pointer, but how can I add a parameter to the textarea
formfield, such as:

==

==

if these formfields are automagically generated by Django?


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



Re: A bit puzzled on how to create the 'complete' website

2006-09-06 Thread Kenneth Gonsalves


On 05-Sep-06, at 7:26 PM, [EMAIL PROTECTED] wrote:

> I have learned that visualising processes is not my forté, so I'm
> probably overseeing (or rather: not grasping) a basic concept here.

make a menu in your base.html and first have one view/template per  
menu item - later factorise

-- 

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



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