If your on Dreamhost, vote for Django support

2009-10-27 Thread Richard Jeong
Thanks to Daniels help, I'm likely going to get my Dreamhost VPS server installed inspite of the problems I had during my attempt at installation. I would like to adovcate that for anyone else who is still on Dreamhost and on this list, vote for Full Django

Re: Dreamhost PS installation problems.

2009-10-22 Thread Richard Jeong
As a follow up, does anyone know of a individual/group that I can pay to help me resolve this error? As this is work related I need to get it resolve and I can't afford to leave dreamhost right now. I'd like to see if I can find someone who can spend an hour or two an help me find out if it's

Re: Using shell to add images

2009-09-22 Thread Richard
No sorry it's late was just typing up the scenario to be more ledgible (i'm doing a lot with random) meant while x < 20. Basically looks like this to add a single image model: from django.core.files import File from job.models import Job, JobPhoto job = Job.objects.get(pk=1544) lp = JobPhoto()

Re: Reusable/plugable apps integrations best practices

2009-08-23 Thread Richard Marko
Simple approach for this is to use try catch block to create proper field like this: from django.db import models try: from photos.models import Photo photo_field = models.ManyToManyField(Photo) except ImportError: photo_field = None class Standalone(models.Model):

Re: accessing multiple dbs?

2009-07-17 Thread Richard E. Cooke
Thanks for the replies! Happily I have managed to avoid the issue. We will just make one Django site per database. Using a web page to post all the different sites, thus making it "look" like its accessing multiple dbs.. Cheap shot I know, but I'm very lazy. Plus I figure by the time I

Re: accessing multiple dbs?

2009-07-15 Thread Richard E. Cooke
OK. Before I get flamed! I neglected to search THIS group before I posted. So, I see some chatter about being able to instansiate a second DB connector. Great. Now, how about where the best examples of that are? And what impact, if any, does this have on the rest of Django? My boss is

accessing multiple dbs?

2009-07-15 Thread Richard E. Cooke
uot; data is in the same db as all "site" data? Thanks in Advance! Richard Cooke Turnkey Automation Inc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

Re: Dynamic App Creation

2009-07-07 Thread Richard Shebora
I ran across this django app and it seems to be what you want... I don't have any experience with it except to try the demo which seems to work as "advertised". http://projects.nickblundell.org.uk/wikidbase Thanks, Richa

Re: Arbitrary HTTP CONNECT attempts on Django dev server

2009-06-29 Thread Richard Shebora
e > > log_message routine in django/core/servers/basehttp.py to be: > > > > def log_message(self, format, *args): > > # Don't bother logging requests for admin images or the favicon. > > if self.path.startswith(self.admin_media_prefix) or sel

Re: Very bad experience in Django...

2009-06-25 Thread Richard Shebora
Chris, I don't know you. But I hope your day gets a little better and your problems lighter. Sincerely, Richard On 6/25/09, Chris Withers <ch...@simplistix.co.uk> wrote: > > > steveneo wrote: > > BooleanField limits only to CheckBox? But I set > > widget=HiddenF

Re: include behavior

2009-06-21 Thread Richard Colley
For 1., did you import play_django? On Jun 21, 11:17 am, tekion wrote: > All, > I noticed that putting single quote around include argument makes a > different, for example: >  (r'^admin/', include(admin.site.urls)), >  (r'^polls/', include('play_django.polls.urls')), > works.

Re: Abstract models and 'blank' (etc.) constraints

2009-06-17 Thread Richard Colley
wrote: > On Wed, Jun 17, 2009 at 14:42, Richard Colley <richard.col...@gmail.com>wrote: > > > > > Thanks TiNo, > > > Are there any caveats with this?  e.g. to make syncdb etc. work > > correctly? > > I don't know, as I never tried, and I am not very e

Re: How do I get a field value instead of in an admin selectbox?

2009-06-17 Thread Richard Colley
The answer was given to you in the previous post. Whatever __unicode__() returns from your model is what will be displayed. So, on your model, define a __unicode__ method: e.g. class Person(...): def __unicode__(self): return self.name On Jun 18, 12:03 am, DaveB

Re: Abstract models and 'blank' (etc.) constraints

2009-06-17 Thread Richard Colley
, and change their > blank attribute to false. > > TiNo > > On Wed, Jun 17, 2009 at 13:32, Richard Colley <richard.col...@gmail.com>wrote: > > > > > Ok, after looking through the django wiki entries for AuditTrail > > (http://code.djangoproject.com/wiki/AuditTrail

Re: Abstract models and 'blank' (etc.) constraints

2009-06-17 Thread Richard Colley
on the desirability of doing this, and potential alternative solutions. Thanks, Richard On Jun 17, 8:03 pm, Richard Colley <richard.col...@gmail.com> wrote: > I have a need to define 2 models, both with a large number of fields > in common, but where in once case these common fields are completel

Abstract models and 'blank' (etc.) constraints

2009-06-17 Thread Richard Colley
lank=False. Without violating DRY, is there any way I can do this in Django? Can I fiddle with the attributes of the fields from class A in class XYZ? Any other solutions? Thanks for any advice, Richard --~--~-~--~~~---~--~~ You received this message becaus

Re: OT: running custom management command from cron & Unicode output error

2009-06-09 Thread Richard Colley
import sys, codecs, locale sys.stdout = codecs.getwriter(locale.getpreferredencoding()) (sys.stdout) or you can hard-code locale.getpreferredencoding() as 'utf-8' On Jun 7, 2:19 am, "Carlos A. Carnero Delgado" wrote: > Hi there! > > I'm having a problem with a custom

Custom annotation: numbering rows?

2009-06-03 Thread Richard Lawrence
! Best, Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-user

Re: Iterate over MultipleChoiceList in Template

2009-05-27 Thread Richard
ed to make Django do that for me so I could keep the line- > by-line error messages to make it clear to users where they goofed > (and without using JS magic 'cause that's another way to do it if you > go the "normal fix" route but I hate relying on things that can be > voluntaril

Re: Iterate over MultipleChoiceList in Template

2009-05-25 Thread Richard
Hey Retro, I'm struggling with the same thing. I've found two interesting links which take two different approaches although I can't get either to quite work (I think the template is just not seeing the actual control but it's not complaining loudly). But it's quite possible that you'll be able

Re: What debugger do you use?

2009-05-13 Thread richard
WingIDE works very well for me on an OsX box. On May 11, 1:53 pm, Joshua Russo wrote: > I'm currently using Netbeans 6.5 with the Python plugin. I was just > wondering what everyone else is using because NB is a bit buggy with > the Python plugin at the moment.

Re: Easy display of table of data without a backing model

2009-05-03 Thread Richard Davies
P.S. An obvious hack would be to save all my data from memory into a Django model, then do the view based on the model. I'd like to avoid that if at all possible, both because it's ugly to save data into the database just to pass it to a view and also because I'd then get into all kinds of

Easy display of table of data without a backing model

2009-05-03 Thread Richard Davies
anyone suggest a way for me to plug my data straight into the existing Django technology for producing nice pages for tables of data, or do I need to start writing templates from scratch? Thanks very much! Richard. --~--~-~--~~~---~--~~ You received this message

Populating list_display with data from two models?

2009-02-26 Thread Jamie Richard Wilson
I've extended the User model with a UserPofile model and have inline editing working. Setup is something like this: class UserProfile(models.Model): user = models.ForeignKey( User, unique=True, ) position = models.ForeignKey(Position) ...etc... I need a

Re: InlineModelAdmin objects question

2009-02-25 Thread Jamie Richard Wilson
This might answer your question: http://groups.google.com/group/django-developers/browse_thread/thread/45bce29f331acb5e Kevin Coyner wrote: > I am using the Auth system in django and have a separate app People > that I'm using to keep more detailed info (i.e. address, phone, etc) > on my

Admin interface for user management

2009-02-25 Thread Jamie Richard Wilson
I'm working on an online newsroom project and have a need to extend the user profile beyond the included basics. I also need to grant permissions to allow the online editorial staff to create new user accounts to associate with new content if the account doesn't already exist. In most cases there

Re: Announcing Django Noob Group

2009-02-19 Thread Richard Shebora
I am also a "noob" who doesn't want to search two lists. Was someone rude to you on this list? On Thu, February 19, 2009 2:11 pm, Bobby Roberts wrote: > > ... simpleton questions welcome, mentors encouraged to help... > > > http://groups.google.com/group/djangonoobs > > > >

Internationalization: XLIFF instead of gettext?

2008-12-17 Thread Richard
. Are there plans to bring XLIFF native internationalization to Django? Thanks, Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@google

Re: invalid syntax - install django 1.0.2

2008-12-17 Thread Richard
e 3.0 transition), but we recommend installing Python 2.5 or later. If you do so, you won’t need to set up a database just yet: Python 2.5 or later includes a lightweight database called SQLite." thanks for the hints :) On Dec 17, 4:02 pm, Richard <ric...@gmx.de> wrote: > Im running Python 3

Re: invalid syntax - install django 1.0.2

2008-12-17 Thread Richard
Im running Python 3.0 and the line 70 is correct in my file: "if u'SVN' in version:" On Dec 17, 3:35 pm, "Alex Koshelev" <daeva...@gmail.com> wrote: > What is your version of python? > > On Wed, Dec 17, 2008 at 21:26, Richard <ric...@gmx.de&g

invalid syntax - install django 1.0.2

2008-12-17 Thread Richard
Hi, when im running the "setup.py install" command in my shell under Windows Vista it returns an syntax error in Line 70 if u'SVN' ^ anybody knows what im doing wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Django storage method question

2008-12-09 Thread Richard Silver
This looks to have been an issue with cStringIO. If I import StringIO instead it seems to work, but only after I create the object. I'd really like to do this: test = PdfFile(business=business1, pdf = f, created = datetime.now()) test.save() however I get this

Re: testing template tags

2008-12-02 Thread Richard Szopa
Thanks a lot. For some reason I haven't noticed the relevant fragment in the docs... Cheers, -- Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

testing template tags

2008-12-01 Thread Richard Szopa
Hello, I have written some doctests for my custom template tags, but `manage.py test my_app' doesn't seem to notice it. There is an __init__.py file in the templatetags directory, but apparently that is not sufficient. Thanks in advance, -- Richard

Re: ManyToMany + through + using add, d

2008-08-29 Thread Richard Ward
It looks like the solution to this is in the newest release. Ref. http://code.djangoproject.com/changeset/8136 On Fri, Aug 29, 2008 at 1:40 AM, akaihola <[EMAIL PROTECTED]> wrote: > > This looks like Gergo's ticket for his original request: > http://code.djangoproject.com/ticket/8334 > > >

Re: ANN: django-morsels

2008-08-28 Thread Richard Ward
I just checked out the newest revision and it works! I am certain this will be a very handy asset. To debug the issue you can use the {% debug %} template tag. Thank you, Richard On Sun, Aug 24, 2008 at 6:11 AM, Richard Ward <[EMAIL PROTECTED]> wrote: > I too am unable to display th

Re: site using Django/mod_python/apache2 randomly showing "It worked!" page

2008-08-28 Thread Richard Simões
I didn't, no (no root access). At what point should that be necessary, if ever? /Richard Simões On Aug 28, 12:11 am, David Zhou <[EMAIL PROTECTED]> wrote: > On Aug 27, 2008, at 9:18 PM, Richard Simões wrote: > > > I have non-root access to a server with apache2 and mod_pytho

site using Django/mod_python/apache2 randomly showing "It worked!" page

2008-08-27 Thread Richard Simões
quot; page pops up. Searching for this problem seems a bit difficult. Any idea on what could be happening? Thanks in advance, Richard Simões --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&

Re: ANN: django-morsels

2008-08-24 Thread Richard Ward
.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors.request", ) I do not know how to debug the installation. Thanks Richard On Sat, Aug 23, 2008 at 12:04 AM, I

Re: Two edit_inlines between the same two models?

2008-07-10 Thread Richard Dahl
, -richard On 7/10/08, Aaron <[EMAIL PROTECTED]> wrote: > > > Is it impossible to have two edit_inline s in a model which refer to > the same other model? I've been trying to do this, and get a > "KeyError" > > The situation is: I'm writing an app to keep tra

Re: Not quite sure how to model the data structure

2008-07-10 Thread Richard Dahl
and children within the model. hth, -richard On 7/10/08, m3scalito <[EMAIL PROTECTED]> wrote: > > > Hi > > I'm quite new to django, and I've found it fantastic to work with, but > I'm having trouble modelling the following structure: > > I have many Guests, each Guest c

Re: foreign key not being defined in admin interface

2008-07-10 Thread Richard Dahl
Are you using trunk? I know that a few months ago there were significant changes to the handling of unicode. I suspect you are on a previous rev. -richard On 7/10/08, allisongardner <[EMAIL PROTECTED]> wrote: > > > Changed it to > def __str__(self): > return s

Re: foreign key not being defined in admin interface

2008-07-10 Thread Richard Dahl
do you have a __unicode__() function for the Protein Model ala: def __unicocde__(self): return ('%s' % (self.name)) -richard On 7/10/08, allisongardner <[EMAIL PROTECTED]> wrote: > > > Sorry about obscure title...don't know what the problem is let alone > its name. > I

Re: Newforms Admin - Overriding the Save Method of an Inline Model

2008-07-02 Thread Richard Dahl
You may be able to do what you want to by overriding the save() function within the model. If you need any information from the form or related object you could pass them as kwargs to save. http://www.djangoproject.com/documentation/model-api/ -richard On 7/2/08, Brian Rosner <[EMAIL PROTEC

Re: Trouble activating the admin interface

2008-07-02 Thread Richard Dahl
Also ensure that you have imported those models into your apps models.py from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType os some such import statement should be at the top of your models.py -richard On 7/2/08, Brian Luft <[EMAIL PROTEC

Re: Polymorphic model: many-to-many is not properly resolved

2008-07-01 Thread Richard Dahl
Yes, of course you did, I just didn't read your post quite right, disregard. -richard :) On 7/1/08, Torsten Bronger <[EMAIL PROTECTED]> wrote: > > > Hallöchen! > > Richard Dahl writes: > > > In your example SpecialProcess inherits from Process and Sample > >

Re: Polymorphic model: many-to-many is not properly resolved

2008-07-01 Thread Richard Dahl
process.__class__.__name__ otherwise, I do not know how SpecialProcess is supposed to fit in to Sample at all. -richard On 7/1/08, Torsten Bronger <[EMAIL PROTECTED]> wrote: > > > Hallöchen! > > I use the current SVN version of Django. > > Consider the following m

Re: combining unrelated tables

2008-07-01 Thread Richard Dahl
Not sure exactly where you are going, but what do you mean by ' Inside views.py it only lets me send 1 queryset to the template' why can't you do something like: render_to_response('Template.html', {'first_qs': Model1.objects.all(), 'second_qs':Model2.objects.all()}) -richard On 7/1/08

Re: views.py: Always a simple return?

2008-06-25 Thread Richard Dahl
or function that can do this... hth, -richard On 6/25/08, RossGK <[EMAIL PROTECTED]> wrote: > > > In a simple XMLhttpRequest I can do an ajax request for some data, > have django look something up and send it to my browser. > > Is the response from the views.py always just a singl

Re: How do I add the user ID to a template?

2008-06-24 Thread Richard Dahl
a variable to the template used to render me! You should call and complain. {% endif %} :) -richard On 6/24/08, Huuuze <[EMAIL PROTECTED]> wrote: > > > Correct me if I'm wrong, but I'm not sure this resolves the core > problem. In your example, I still need to add somethi

Re: psycopg2

2008-06-24 Thread Richard Dahl
, to justify using it. hth, -richard On 6/24/08, Will <[EMAIL PROTECTED]> wrote: > > > I'm working on a project I'd like to use Django for, though my first > hurdle will be convincing a team of highly qualified scientists, > programmers and computer scientists that this is a go

Re: How do I add the user ID to a template?

2008-06-24 Thread Richard Dahl
That (or some variation) is the simplest way to do it, although you do not need to attach the entire request object if you do not want to, i.e.: return render_to_response('somepage.html', {'username':request.user.username}) {{ username }} On 6/24/08, Huuuze <[EMAIL PROTECTED]> wrote: > > > A

Re: Multiple fields without manytomanyfield?

2008-06-23 Thread Richard Dahl
I am a bit confused, are you looking for this: class IntegerRelation(models.Model): content = models.IntegerField() class A(models.Model): integers = models.ManyToManyField(IntegerRelation) -richard On 6/22/08, Xan <[EMAIL PROTECTED]> wrote: > > > Hi, > > Supo

Re: retrieving record id after form save

2008-06-23 Thread Richard Dahl
new_obj = form.save() new_objects_id = new_obj.id hth, -richard On 6/23/08, Calvin Dodge <[EMAIL PROTECTED]> wrote: > > > I need to get the id of a record after saving it with form.save(). I'm > not seeing this described in the docs, and haven't dredged anything up > by

New site - any comments please on structure / bugs/ security holes etc etc.

2008-06-22 Thread Richard Green
Hi there - I've just put a noddy site together so that I could give myself a real goal for getting a django based site running. I've got a few bigger internet ideas but I thought I'd do something small to start with to test the feasility of writing it in django, before embarking on a route using

Re: Need help encapsulating a form

2008-06-20 Thread Richard Dahl
, but that is primarily because I am far more comfortable with python than JS. -richard On 6/20/08, Brandon Taylor <[EMAIL PROTECTED]> wrote: > > > Ah, I see now. > > Here's my views.py file now: > > from django.shortcuts import render_to_response, get_object_or_404 &g

Re: Need help encapsulating a form

2008-06-20 Thread Richard Dahl
. Move: return HttpResponseRedirect('/articles-and-books/thanks/') back to the views and get rid of the render_to_response. On 6/20/08, Brandon Taylor <[EMAIL PROTECTED]> wrote: > > > Hi Richard, > > Thanks for taking the tie to address my question. Here's my current > v

Re: Need help encapsulating a form

2008-06-20 Thread Richard Dahl
ocessemail(email, reference_name): request.session['first_name'] = first_name return HttpResponseRedirect('/articles-and-books/thanks/') you could have it do all of the form processing if you need it too, just depends on what you need. -richard On 6/20/08, Brandon Tayl

Re: Accessing model from view

2008-06-20 Thread Richard Dahl
You should be able to access it in a template from an instance of a model that uses it via: model_instance_object.ROLES but if you just want to access from the template generically, then yes, you need to pass it to the template. hth, -richard On 6/20/08, diggs <[EMAIL PROTECTED]>

Re: Accessing model from view

2008-06-20 Thread Richard Dahl
sure, its just python: for r in ROLES: r[0] #retrieves 'Associate' the first iteration r[1] # also retrieves 'Associate' You just need to ensure that ROLES is imported into your views. hth, -richard On 6/20/08, diggs <[EMAIL PROTECTED]> wrote: > > > Hello, > &g

Re: Models advice

2008-06-20 Thread Richard Dahl
. Obviously there are tradeoffs between normalizing data and speed of queries, but I thnk the suggestion still holds. hth, -richard On 6/19/08, joshuajonah <[EMAIL PROTECTED]> wrote: > > > I am making a database of advertisers, product categories, products > (advertise

Re: insert row into ManyToManyField

2008-06-18 Thread Richard Dahl
,Belgium/300Km, etc... hth, -richard On 6/18/08, Dan <[EMAIL PROTECTED]> wrote: > > > You'll have to do something like this: > > Country(models.Model): >name = models.CharField(max_length = 100) >boders = models.ManyToManyField('self') > >Meta: >

Re: iterate over alphabet in template

2008-06-17 Thread Richard Dahl
I would probably just pass in a python list with all of the letters in the alphabet, then just {% for l in alphabet_list %} ... -richard On 6/17/08, M.Ganesh <[EMAIL PROTECTED]> wrote: > > > Hi All, > > I am relatively new to both python and django. Please help me to do thi

Re: What am I doing that is sooo wrong with newforms??

2008-06-17 Thread Richard Green
Thanks - it was late and I got my objects messed up. I did try the commit=False save but then I wasn't saving the object returned, but assigning to the same object (i.e. form) and trying to RESAVE that.. Thanks again. Richard (another happy django convert). On Jun 17, 12:03 am, "[

What am I doing that is sooo wrong with newforms??

2008-06-16 Thread Richard Green
. A working 20 line example would suit me grandly !! Thanks in advance, Richard. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@google

Re: HTML Escaping JSON data?

2008-06-16 Thread Richard Dahl
with newforms and it will be escaped when saving to the DB. If there is something else you are concerned about or trying to do, a bit more information may result in better responses. hth, -richard On 6/16/08, Knifa <[EMAIL PROTECTED]> wrote: > > > Err, nevermind that actually. It didn

Re: Form Validation

2008-06-11 Thread Richard Dahl
Just an idea, not sure if it will work for you as I don't know a whole lot about how it works, but wouldn't setting unique_together on the Relation class for owner and pet accomplish what you want? The validation happens at the DB level, but I believe it propogates back to the form. hth, -richard

Re: Total newbie question

2008-06-10 Thread Richard Dahl
I would start with 'Dive into Python' or 'How to think like a computer scientist in python' to gain familiarity with basic python concepts. -richard On 6/10/08, Pedro Cora <[EMAIL PROTECTED]> wrote: > > > First of all, sorry if i'm making a question that should appear a lot

Re: HELP: Foreign keys, models, and querysets

2008-06-09 Thread Richard Dahl
) as when you use it you are getting the related objects rather than just related ids, but this is obviously a matter of ones personal taste. hth, -richard On 6/9/08, Huuuze <[EMAIL PROTECTED]> wrote: > > > I have the following models in my models.py file: > > >> c

Re: Django Suitable for this?

2008-06-08 Thread Richard Dahl
) and I looked at other python web frameworks (TG and pylons) and decided that while I probably would never use the built-in Admin interface for much, if anything, in production, Django provided the best framework for my app. hth, -richard On Jun 8, 2008, at 1:05 AM, beetlecube wrote: >

Re: use my own widgets when creating a form out of a model

2008-06-05 Thread Richard Dahl
I have implemented this by looping through the form fields in a generic form creation function. Not sure if it is the 'proper way' but it works very well for me. -richard On 6/5/08, Wim Feijen <[EMAIL PROTECTED]> wrote: > > > Hi Richard and Rishabh, > > Thanks for your

Re: use my own widgets when creating a form out of a model

2008-06-04 Thread Richard Dahl
={'size':'40'})) hth, -richard On 6/4/08, Wim Feijen <[EMAIL PROTECTED]> wrote: > > > Hello people, > > Being able to work with Django is very helpful to me. However, I am > unsure whether I can create a form out of a database model and then > customize that form

Re: Philosophical Django Questions

2008-05-30 Thread Richard Dahl
model with a one to one back to user. So assuming you have UserProfile you could have: UserGame(models.Model): user_profile = FK(UserProfile) game = FK(Game) high_score = integer() my $0.02 -richard On 5/30/08, Apreche <[EMAIL PROTECTED]> wrote: > > > Hi, I'm a long

Re: Problem State/City Relations

2008-05-30 Thread Richard Dahl
choice widget. -richard On 5/30/08, mimito <[EMAIL PROTECTED]> wrote: > > > I have a form that has two fields (ModelChoiceField) > > 1. State > 2. City > > City and State from Spain. > > How do to display o

Re: order_by foreign key problem

2008-05-29 Thread Richard Dahl
relationships ahead of time. Try to do it without the select_related to see if you can get the query to execute. I know this will mean an additional hit on the db to access the related model, but I can't think of anything else. hth, -richard On 5/29/08, robstar <[EMAIL PROTECTED]>

Re: order_by foreign key problem

2008-05-29 Thread Richard Dahl
') hth, -richard On 5/29/08, robstar <[EMAIL PROTECTED]> wrote: > > > Hey guys, > > I read through some of the threads here, but still can't get this > simple scenario to work.. > > DB name: gcdb > > class Item(models.Model): > hits= models

Re: ModelChoiceField, Cascading Selections

2008-05-29 Thread Richard Dahl
and State for them. The way you have described sounds a bit overly complex from a usability point of view. But I obviously do not understand your detailed requirements. HTH, -richard On 5/29/08, Adi <[EMAIL PROTECTED]> wrote: > > > I have a form that has three fields > 1. Sta

Re: Just getting started

2008-05-29 Thread Richard Dahl
and I would agree with Eric's comments. Recently the idea of using Google Gears has piqued my interest, but I have not adequatley researched it to recommend its viability. The biggest downside is of course, you're not using django on the local app then. -richard On 5/29/08, Eric Wertman &l

Re: hijacked python-pgsql page?

2008-05-28 Thread Richard Dahl
initd.org is having problems with thier Trac implementation. -richard On 5/28/08, Andrew D. Ball <[EMAIL PROTECTED]> wrote: > > > Good afternoon. > > When I follow the following link from the Django > Book, v1.0 to information about using Django > with PostgreSQL,

Re: Enforcing case sensitivity at Model level

2008-05-27 Thread Richard Dahl
letters. I think you want option 1, it would be the simplest, but it would allow users to enter capital letters, they just would be saved to the DB as lowercase. hth, -richard On 5/27/08, JonSidnell <[EMAIL PROTECTED]> wrote: > > > Hi > > I'm developing my first proper D

Re: ManyToManyField, add custom column

2008-05-27 Thread Richard Dahl
): return ('%s %s' % (self.number, self.fruit.__unicode__())) class FruitBag(models.Model): items = models.ManyToManyField(FruitItem) HTH, -richard On 5/27/08, Vladimir <[EMAIL PROTECTED]> wrote: > > > i have a question > > is it possible to create 2 models &

Re: Difference between using postgresql_psycopg2 vs postgresql

2008-05-24 Thread Richard Dahl
environment last year, there was a disclaimer at initd.org that essentially said psycopg2 is the one 'you should use', so I went with it. I have not noticed any differences, but all of my interaction with the database through the ORM is pretty tame. HTH, -richard On May 24, 2008, at 2:23 PM

Re: Generic ManyToMany - any code?

2008-05-24 Thread Richard Dahl
= models.ForeignKey(ContentType, unique=True) def __unicode__(self): return ('%s' % (self.type.__unicode__().capitalize())) HTH, -richard On May 24, 2008, at 2:55 AM, Itai Tavor wrote: > > Hi, > > There was some talk about creating generic M2M fields around the end > of '

Re: dynamic filtering (with jQuery)

2008-05-23 Thread Richard Dahl
Firebug is where you will get django's errors, if you are using an async call to django (AJAX, XHR, etc..) -richard On 5/23/08, Peter Rowell <[EMAIL PROTECTED]> wrote: > > > > The debug information is available from firebug. You will see the > reuest, > > right c

Re: storing a list of arbitrary generic objects in a db field

2008-05-23 Thread Richard Dahl
be set. -richard On 5/23/08, Peter Rowell <[EMAIL PROTECTED]> wrote: > > > > Thoughts on this approach? > > I do this all the time. I call them objrefs (Object References). > > My syntax is ..id. If the model_name is unique > across the project (which is normally t

Re: dynamic filtering (with jQuery)

2008-05-23 Thread Richard Dahl
The debug information is available from firebug. You will see the reuest, right click on it and select 'Open in New Tab' -richard On 5/23/08, Joseph <[EMAIL PROTECTED]> wrote: > > > Peter: Thanks for the reply. > > I do have DEBUG=True. > I have tried both 1/0 and assert

Re: Forms from Database Tables with choice selects.

2008-05-22 Thread Richard Dahl
) -- OR -- class Plan(models.Model): members = M2M(Member) hth, -richard On 5/22/08, Lance F. Squire <[EMAIL PROTECTED]> wrote: > > > Currently, I'm working from the demos in the book and the site. > > Here is what I have currently. > > forms.py: > > from djang

Re: Forms from Database Tables with choice selects.

2008-05-21 Thread Richard Dahl
and the business logic it supports. If you went this route, you could present a user with a form for ThreeRelatedPeople and they could choose three existing or create the requisite Person objects. -richard On 5/21/08, Lance F. Squire <[EMAIL PROTECTED]> wrote: > > > I'm trying to make

Re: Reusable models?

2008-05-21 Thread Richard Dahl
underthinking this? -richard On 5/21/08, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > > > James Bennett introduced some handy tricks about forms, templates, and > URLs in his presentation about reusable apps: > http://www.b-list.org/weblog/2008/mar/15/slides/ > > However the

Re: relationships problem

2008-05-21 Thread Richard Dahl
to extend Resource? Another solution is to have Place have a M2M relationship to Resource, which sounds more logical to me (of course, I have no idea what your app is designed to do) as any Place (probably) has more than one Resource. hth, -richard On 5/21/08, Col Wilson <[EMAIL PROTECTED]>

Re: "request"object within models.py

2008-05-19 Thread Richard Dahl
now it never dawned on me that I could just do that in my views! Thanks again -richard On May 19, 2008, at 4:17 PM, James Bennett wrote: > > On Mon, May 19, 2008 at 4:10 PM, Tim Chase > <[EMAIL PROTECTED]> wrote: >> It's the last bit that can throw folks...many folks see

Re: "request"object within models.py

2008-05-19 Thread Richard Dahl
how do you pass the request object to models? -richard On 5/19/08, James Bennett <[EMAIL PROTECTED]> wrote: > > > On Mon, May 19, 2008 at 3:24 PM, enri57ar <[EMAIL PROTECTED]> wrote: > > How access to request object within models ? > > Pass it as an argument the

Re: questions about templates within templates and ajax pop-up window

2008-05-19 Thread Richard Dahl
at more clear > so please keep'em coming > > On May 19, 9:33 pm, sebey <[EMAIL PROTECTED]> wrote: > > ok but I may want enable it and disable it and change the message form > > time to time which is why I would like it go though django > > > > On

Re: questions about templates within templates and ajax pop-up window

2008-05-19 Thread Richard Dahl
used/etc...) or just relies on a static message hardcoded into the template (or a mix of the two) and returns it. Changing the message is as simple as updating a database record, modifying a function, or changing a snippet on a template, depending on where it is stored. -richard On 5/19/08, sebey

Re: "request"object within models.py

2008-05-19 Thread Richard Dahl
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser -richard On 5/19/08, enri57ar <[EMAIL PROTECTED]> wrote: > > > How access to request object within models ? > > > from django.contrib.auth.models import User > > Class Message(models.Model): &

Re: questions about templates within templates and ajax pop-up window

2008-05-19 Thread Richard Dahl
containing the content of the message, or perhaps only the dynamic part of the message, to be processed by a javascript callback. hth, -richard On 5/19/08, sebey <[EMAIL PROTECTED]> wrote: > > can you load a template in a template and I what at time to have when > you go to my sit

Re: How to add an object with relations to other objects

2008-05-17 Thread Richard Dahl
You can always just pass the id of A into the template for creating the B and have it submitted along with the form. Then after you save the B you will have to get the A and save the instance of B to its relation. -richard On May 17, 2008, at 3:02 AM, jabbercat wrote: > >

Re: How to add an object with relations to other objects

2008-05-16 Thread Richard Dahl
than my intellectual meanderings. -richard On 5/16/08, jabbercat <[EMAIL PROTECTED]> wrote: > > > Hello, > > it's my frist time I'm using this Group. > > My Problems: > I have a class A and a class B with a one(A)-to-many(B) relationship > between them. > > M

Re: Add column to generated ManyToMany table and access from admin

2008-05-16 Thread Richard Dahl
' constraint to your meta class in ItemOrder, if helpful. hth, -richard On 5/16/08, Peter Bailey <[EMAIL PROTECTED]> wrote: > > I am pretty new to Django, and am building a web generating app. I am > hoping to get a lot of functionality out of the admin. So far that is > working great. I

Re: Keeping track of which user did what

2008-05-16 Thread Richard Dahl
This can be done with the threadlocals middleware: http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser On 5/16/08, Chris Farley <[EMAIL PROTECTED]> wrote: > > > Django has that nice "auto_add=True" property you can set on a model's > field. I have two fields in my models called

<    1   2   3   4   >