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"

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"

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

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

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

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('''

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.

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

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

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"

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

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 =

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)

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

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

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

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

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

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 =

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

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.

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

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

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

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

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:

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

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

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

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

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

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

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

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

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

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':

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

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

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

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

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

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

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

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:

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

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

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

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

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

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?

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

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,

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:

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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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

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

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']

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?

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