Re: "id may not be NULL" during save in one-to-many relationship

2009-04-08 Thread Hostile Fork
On Apr 7, 9:53 pm, Malcolm Tredinnick wrote: > At that point in the first tutorial, subtleties like > this are not of paramount importance. It's the beginner's > tutorial, not a reference document. Hrm... well, I'd argue that in a system which synchronizes database tables with in-memory objects

Django 1.0.x Advantages/Features.

2009-04-08 Thread Harish
Hi Folks, I want to know the advantage / features of django 1.0.x over pre 1 version.. Can any one have a list of advantage / features or url which will be helpfull for me to evaluate... Thanks and Best Regards Harish Bhat M --~--~-~--~~~---~--~~ You received th

Re: Django 1.0.x Advantages/Features.

2009-04-08 Thread Kenneth Gonsalves
On Wednesday 08 April 2009 12:37:45 Harish wrote: > I want to know the advantage / features of django 1.0.x over pre 1 > version.. all changes in 1.0.x will be backward compatible. If you go for pre 1.0, you will sooner or later be faced with a huge migration problem. -- regards kg http://lawgo

Re: Django 1.0.x Advantages/Features.

2009-04-08 Thread Malcolm Tredinnick
On Wed, 2009-04-08 at 00:07 -0700, Harish wrote: > Hi Folks, > > I want to know the advantage / features of django 1.0.x over pre 1 > version.. > > Can any one have a list of advantage / features or url which will be > helpfull for me to evaluate... A very significant consideration here is tha

Re: Something is eating memory. How to track it down?

2009-04-08 Thread Andy Baker
Wow! So Python will eat RAM until restarted? That changes the way I am thinking about this problem. So the trick will be tweaking the number of processes and the number of requests allowed between a restart. I know one item requests a big chunk of memory is dynamic PDF generation. So lets say thi

Re: Many Questions, some of which are theoretical

2009-04-08 Thread akaihola
zayatzz, There are also lots of great re-usable apps for Django to get you jump- started. Here are some I've been happy with and which probably intersect with features you're looking for: sorl-thumbnail django-photologue django-page-cms django-rendertext django-cairo-text See also: http://django

Re: Uploading music or videos (seeking django package)

2009-04-08 Thread akaihola
> I'd like to upload music and/or photos and/or videos to my website, > with the emphasis on mp3. If you're looking for re-usable apps, these two simple apps will get you started: django-attachments (on Google Code) django-uploads (on GitHub) They might also work together with django-massmedia,

Re: Many Questions, some of which are theoretical

2009-04-08 Thread zayatzz
Thanks again. Already have this thread bookmarked. Im at work now, reading about django instead of actually working. Damn i have too little time and too much to read :). Alan. On Apr 8, 11:09 am, akaihola wrote: > zayatzz, > > There are also lots of great re-usable apps for Django to get you ju

Re: Help DjangoDecode Error

2009-04-08 Thread Karen Tracey
On Tue, Apr 7, 2009 at 5:15 PM, CrabbyPete wrote: > > I keep getting this message when I try to save a record to my database > DjangoDecodeError: 'utf8' codec can't decode byte 0xae in position 268 > > I have __unicode__ defined in my models. I changed mysql to use utf8. > I don't know what else

Re: Something is eating memory. How to track it down?

2009-04-08 Thread Graham Dumpleton
On Apr 8, 5:43 pm, Andy Baker wrote: > Wow! So Python will eat RAM until restarted? That changes the way I am > thinking about this problem. > > So the trick will be tweaking the number of processes and the number of > requests allowed between a restart. I know one item requests a big chunk of

Re: Querysets and ROW_NUMBER

2009-04-08 Thread Tim Chase
adrian wrote: > Was wondering if anyone can point me in the right direction here, what > would be the Django style way to annotate a set with a row number in > some way like:- > > Book.objects.all().order_by('date_added').annotate(row_num=RowNumber > ('id')) Well many times the "Django style way

Re: Iterating over a field using widget=ChekboxSelectMultiple

2009-04-08 Thread Jim
For now, there's no > particularly good workaround beyond writing your own widget or manually > writing the HTML. Thank you, Malcolm. Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: "python2.5 manage.py syncdb" ...No module named _sqlite3

2009-04-08 Thread Karen Tracey
On Tue, Apr 7, 2009 at 8:39 PM, George wrote: > > Hi- > > I'm pretty sure this shouldn't happen; but the error is no doubt my > fault. Maybe something about the doc doesn't apply to my system? I > have pkgsrc python2.5 and Django 1.0.2 > What sort of a system is this? I'm not familiar with pkgs

access dict attribute with space in the key

2009-04-08 Thread rslee
I have dict named "servers". With in it, there is a key called "num of cpu". In Python, I can access this as servers["num of cpu"]. In Django, how can I access this dict item. I tried the following but they do not work: {{servers.num of cpu}}, {{"servers.num of cpu}}, {{servers."num of cpu"}}

registration and profile must save at a time

2009-04-08 Thread Praveen
hi all i have one very intrested question when we write /accounts/ register/ then on browser i get 5 field username,pwd,cnfpwd,firstname,lastname but i want to add two more fields city, age on registration form. i know i can use django-profiles to extend User and can save to UserProfile but i am n

How To Change App Label in Admin Pages

2009-04-08 Thread Burcu Hamamcıoğlu
I have a question about Internationalization; is there anyway to change the name of app name in admin pages. But I dont't want to override admin html pages. Can i add a new name to appp like verbose name in models? --~--~-~--~~~---~--~~ You received this message bec

Ignore Fixtures or Skip Fixtures

2009-04-08 Thread Adam Nelson
Is there any way to ignore fixtures when running syncdb? I'm using django-command-extensions and when using runscript from a previous datadump, I get a unique index violation. I'd like to be able to ignore fixture imports. Thanks for any help, Adam --~--~-~--~~~---~-

Re: 0.96 admin inline - post-save on saved related items

2009-04-08 Thread Earthtalker
Adding the desired code (just 2 lines) to the post-SAVE of the Photos model seems to have largely fixed this... it now gets the processing done for new or changed Photos items, but not for deleted items. YEAH! almost. On Apr 7, 3:11 pm, Earthtalker wrote: > Hello - > > I have a model called Cate

Re: need a multiselect list box for a static list of options

2009-04-08 Thread ramu...@gmail.com
Adam, did you solve you problem? I try to solve the same problem here http://stackoverflow.com/questions/723639/forms-selectmultiple-from-models-commaseparatedintegerfield On Apr 7, 5:47 pm, Adam Fraser wrote: > Yup:>>> django.get_version() > > u'0.97-pre-SVN-unknown' > > On Apr 6, 1:45 pm, Al

OperationError: fe_sendauth: no password supplied

2009-04-08 Thread LeeRisq
I've been following along with the Djangobook. When I try to configure the postgresql db, I get that error. I've tried tracing the problem myself and have been unsuccessful. >From Chapter 5: >>> from django.db import connection >>> cursor = connection.cursor() Then I get the error. Any ideas?

Problem setting up Admin site per chapter 6

2009-04-08 Thread Xpineapple
Per manual ( www.djangobook.com/en/2.0/ ), Chapter 6, I try to setup the admin site. My version of Django is (1, 0, 2, 'final', 0) which is covered by this manual. However, after following guidance on activating site, I get this error when running server and going to http://127.0.0.1:8000/admin

request.user Null value in foreign key save[Repost]

2009-04-08 Thread ramya
class Property(models.Model): property_id = models.AutoField(primary_key = True) property_name = models.CharField("Name", max_length = 30) user = models.ForeignKey(User) class PropertyForm(ModelForm): class Meta: model = Property exclude = ('user') def addProperty(request): for

Re: OperationError: fe_sendauth: no password supplied

2009-04-08 Thread Randy Barlow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 LeeRisq wrote: > I've been following along with the Djangobook. When I try to configure > the postgresql db, I get that error. I've tried tracing the problem > myself and have been unsuccessful. > > From Chapter 5: > from django.db import conne

ForeignKey to a Base Model and Relationships with the Inherited Models

2009-04-08 Thread cfiles
Is it possible to force a base model to have a sub model? Consider the following model... class Account(models.Model): user= models.ForeignKey('auth.User') name= models.CharField(max_length=100) description = models.CharField(max_length=35, blank=True) date_added

Re: OperationError: fe_sendauth: no password supplied

2009-04-08 Thread Adi Sieker
Hi, a full traceback would be helpful. did you supply a password for your database in the settings.py? adi On 08.04.2009, at 15:12, LeeRisq wrote: > > I've been following along with the Djangobook. When I try to configure > the postgresql db, I get that error. I've tried tracing the problem >

Re: Problem setting up Admin site per chapter 6

2009-04-08 Thread Alex Gaynor
On Wed, Apr 8, 2009 at 10:24 AM, Xpineapple wrote: > > > Per manual ( www.djangobook.com/en/2.0/ ), Chapter 6, I try to setup > the admin site. My version of Django is (1, 0, 2, 'final', 0) which > is covered by this manual. > > However, after following guidance on activating site, I get this er

Re: request.user Null value in foreign key save[Repost]

2009-04-08 Thread Adi Sieker
Hi, On 08.04.2009, at 16:43, ramya wrote: > > class Property(models.Model): > property_id = models.AutoField(primary_key = True) > property_name = models.CharField("Name", max_length = 30) > user = models.ForeignKey(User) > > class PropertyForm(ModelForm): > class Meta: >model = Property

Re: Pre-filling form data without submission?

2009-04-08 Thread Facundo Casco
On Tue, Jan 20, 2009 at 11:17 AM, shogunm...@googlemail.com wrote: > > Thanks guys, I'm gonna give this a try! > > Mike. Hi, I'm having the exact same problem you had and I can't find a nice way around it. I want the name of the currently logged in user to be pre-selected in a combo box in the fo

Re: Ignore Fixtures or Skip Fixtures

2009-04-08 Thread Russell Keith-Magee
On Wed, Apr 8, 2009 at 10:27 PM, Adam Nelson wrote: > > Is there any way to ignore fixtures when running syncdb?  I'm using > django-command-extensions and when using runscript from a previous > datadump, I get a unique index violation.  I'd like to be able to > ignore fixture imports. 1) Yes -

Re: Pre-filling form data without submission?

2009-04-08 Thread Adi Sieker
On 08.04.2009, at 17:10, Facundo Casco wrote: > > On Tue, Jan 20, 2009 at 11:17 AM, shogunm...@googlemail.com > wrote: >> >> Thanks guys, I'm gonna give this a try! >> >> Mike. > Hi, I'm having the exact same problem you had and I can't find a nice > way around it. > I want the name of the curr

Looking for something lighter than Sproutcore or Cappuccino that integrates well with Django

2009-04-08 Thread Rob Madole
I've been looking at a couple of RIA frameworks, namely Sproutcore and Cappuccino. The feel a bit too heavy for me. Sproutcore does not integrate well with Django. Cappuccino uses Objective-J as the language and I'm not convinced this is a good choice for our team. The reason I'm posting is to

Re: Pre-filling form data without submission?

2009-04-08 Thread Facundo Casco
On Wed, Apr 8, 2009 at 12:28 PM, Adi Sieker wrote: > > If you create tHe Form ala > > form = Form( initial={'user': request.user}) > > it should prepopulate the field and not throw validation errors. > > if on the other hand you create the form like: > > form = Form({'user': request.user}) > > yo

Re: Ignore Fixtures or Skip Fixtures

2009-04-08 Thread Adam N
On Apr 8, 11:13 am, Russell Keith-Magee wrote: > On Wed, Apr 8, 2009 at 10:27 PM, Adam Nelson wrote: > > > Is there any way to ignore fixtures when running syncdb?  I'm using > > django-command-extensions and when using runscript from a previous > > datadump, I get a unique index violation.  I

Re: request.user Null value in foreign key save[Repost]

2009-04-08 Thread ramya
Exactly.. That worked.. Thanks a ton.. I should save with the object returned from formContent.save(commit = False) new_property = formContent.save(commit=False) .. new_property.save() Thanks, Ramya Krishnan On Apr 8, 11:06 am, Adi Sieker wrote: > Hi, > > On 08.04.2009, at 16:43, ramya wrote:

Re: Pre-filling form data without submission?

2009-04-08 Thread Hernan Olivera
My (working code)solution: form = CargaRecetaForm(initial={'obra_social':str(os.siglaosocial), 'plan':str(plan.descplan), 'CU': str(numfar), 'NrodeOrden': str(sigord)}) contexto = RequestContext(request, {'form':form}) return render_to_response('carga_page2.html', contexto) -- Hernan Olivera

pull down form

2009-04-08 Thread nixon66
Anyone have a good example of using a pull down menu in a Django template. I've just finished working through search forms, but couldn't find any examples of a pull down menu. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: pull down form

2009-04-08 Thread phoebebright
I like YUI and that has lots of menu possibilities - http://developer.yahoo.com/yui/menu/ On Apr 8, 5:43 pm, nixon66 wrote: > Anyone have a good example of using a pull down menu in a Django > template. I've just finished working through search forms, but > couldn't find any examples of a pull

urlpatterns helper

2009-04-08 Thread Rit
I'm working on url pattern helper app; design to eliminate the need to edit the "urls.py" file more only once. I need inputs and pointers on what is best to approach this. here is the detail: http://code.google.com/p/django-durl/ --~--~-~--~~~---~--~~ You received

Help Figuring Out Relationships

2009-04-08 Thread PipeManMusic
I'm working on a project that handles Discography's and I am having trouble figuring out the relationships. Artist: Can belong to more than one Group play more than one Instument/ Production Role on more than one Album and could vary based on the Song Song: Can be on more than one Album, be play

Form Wizard and captcha

2009-04-08 Thread qrilka
I've stumbled upon from revalidation in form wizard. The similar problem was discussed a year ago - http://groups.google.com/group/django-users/browse_thread/thread/a6fdf2971f96deed/6313eb5a18a40085 I have somewhat different problem: on the last of my forms I use captcha field, but after successfu

Many Models, One Form with newforms?

2009-04-08 Thread robstar
Hey guys, I'm working on a recipe engine and need to consolidate all the related models for one Recipe on one page for editing purposes... Suppose I have: model Recipe fk <-model Recipe Parts fk <- model Ingredients

Re: OperationError: fe_sendauth: no password supplied

2009-04-08 Thread LeeRisq
I've copied the Traceback below. >>> from django.db import connection >>> cursor = connection.cursor() Traceback (most recent call last): File "", line 1, in File "C:\Python25\lib\site-packages\django\db\backends\__init__.py", line 56, in cursor cursor = self._cursor(settings) File "C:

Re: Many Models, One Form with newforms?

2009-04-08 Thread Masklinn
On 8 Apr 2009, at 20:51 , robstar wrote: > Hey guys, > > I'm working on a recipe engine and need to consolidate all the related > models for one Recipe on one page for editing purposes... Suppose I > have: > > model Recipe > fk <-model Recipe Parts > fk <

Re: A long way ...

2009-04-08 Thread mettwoch
Thanks a lot Malcolm! I'll start moving the TurboGears hand-written admin to the Django admin and keep MySQL. I've one more philosophic question: The model in Django should hold the business rules, right? So let's say that there's a "product" class that knows to calculate it's "stock" through the

Re: Looking for something lighter than Sproutcore or Cappuccino that integrates well with Django

2009-04-08 Thread Scott Newman
> I've been looking at a couple of RIA frameworks, namely Sproutcore and > Cappuccino.  The feel a bit too heavy for me.  Sproutcore does not > integrate well with Django > The reason I'm posting is to ask the community if they have know of > anything that is at a higher level than jQuery + jQuer

Re: Click-wrap license (seeking django application)

2009-04-08 Thread Michael Newman
Hello; On Apr 7, 4:55 pm, Social Network in DJango wrote: > I'm interested in activating a click-wrap license, similar to what you > get when you install a new program or package, on a pc or osx. So to get this straight, you want to greet a user with a pr0n style 'enter here only if you agree'

Re: urlpatterns helper

2009-04-08 Thread Michael Newman
On Apr 8, 2:31 pm, Rit wrote: > I'm working on url pattern helper app; design to eliminate the need to > edit the "urls.py" file more only once. I need inputs and pointers on > what is best to approach this. > > here is the detail: > > http://code.google.com/p/django-durl/ This is an interesting

Details

2009-04-08 Thread zayatzz
There are always some details im unable to find on web. I understand that i ask questions to which everybody wants to answer the current RTFM equivalent - google it, but either my googling skills suck or there are no such info out there... so here i go again. How to write not equal if statement i

Re: Details

2009-04-08 Thread zayatzz
> >         if 'language' in request.session: >                 WTF = 1 >         else: >                 request.session['language'] = > lang.objects.get(fdef=True).short > Figured this one out by trial and error.. replaced in with not in and it worked just fine. Could still use help with url

Re: raise ValidationError has no effect

2009-04-08 Thread brian
I think I'm having the same issue. Did you ever find a solution? On Feb 14, 5:06 pm, Karen Tracey wrote: > On Sat, Feb 14, 2009 at 11:07 AM, Alistair Marshall < > > runninga...@googlemail.com> wrote: > > > I have been trying to create a custom field that allows the user to > > enter a flowrate

Carrier Switch invites every one to Join us.

2009-04-08 Thread Carrier Switch
We are looking for talented people who want more than just a career change. We need people who want to change the communications world. Come to where the truly unique opportunities are. We invite experts, engineers and programmers to participate in a large interesting project. 1. *Senior Software

Re: urlpatterns helper

2009-04-08 Thread Rit
On Apr 8, 1:41 pm, Michael Newman wrote: > On Apr 8, 2:31 pm, Rit wrote: > All you would need then is a method to register views to the durl > module and then make sure the the views get imported before the > urlpattern is matched. Should be pretty fun. Good luck! > > Michael Thank you, Micha

Re: Looking for something lighter than Sproutcore or Cappuccino that integrates well with Django

2009-04-08 Thread Raymond Cote
Rob Madole wrote: > The reason I'm posting is to ask the community if they have know of > anything that is at a higher level than jQuery + jQuery UI and a lower > level than Sproutcore/Cappuccino. I'd like to find something that has > this kind of stuff in it: > From what I've seen, once you

Re: urlpatterns helper

2009-04-08 Thread Michael
On Wed, Apr 8, 2009 at 5:16 PM, Rit wrote: > > On Apr 8, 1:41 pm, Michael Newman wrote: > > On Apr 8, 2:31 pm, Rit wrote: > > All you would need then is a method to register views to the durl > > module and then make sure the the views get imported before the > > urlpattern is matched. Should b

Re: Django Deployment Methods: Survey (via DjangoSites)

2009-04-08 Thread Ross Poulton
I'm already seeing a number of responses to this which is great. On Apr 7, 7:56 pm, Oli Warner wrote: > Please add Cherokee to the server choices and SCGI to the method choices. I > can't edit my sites (accurately) until you have. I knew I'd miss something. I've added those options, thank you.

UserProfile / admin.site.unregister / "'PropertiedClass' object is not iterable" Error

2009-04-08 Thread James
I'm a bit new to all this. I was trying to implement the UserProfile feature described here: http://www.thenestedfloat.com/articles/displaying-custom-user-profile-fields-in-djangos-admin But when it comes time to add that to the admin side of things (in appengine), I get the error: 'PropertiedCl

set default value for combo-boxes in admin interface

2009-04-08 Thread Great Kindness
I'm just getting started with django. When I'm using the admin interface to add or edit data, some of the data fields are populated via drop-down lists. The default for these lists is always ''. How can I get it to default to a particular value in that list? --~--~-~--~~--

Re: Details

2009-04-08 Thread Briel
Hi. When you have a problem it's great to be explicit about it so we don't have to both guess your problem and find a solution. Does your 2nd urlconf throw an error, are the urls not as expected or something else. Post tracebacks aswell if errors are thrown, makes it a lot easier to detect the er

Re: raise ValidationError has no effect

2009-04-08 Thread Alistair Marshall
2009/4/8 brian : > > I think I'm having the same issue.  Did you ever find a solution? > Yea, Karen Tracey was right in my case: > On Feb 14, 5:06 pm, Karen Tracey wrote: >> On Sat, Feb 14, 2009 at 11:07 AM, Alistair Marshall < >> this is covered here: >> >> http://docs.djangoproject.com/en/dev

Re: Something is eating memory. How to track it down?

2009-04-08 Thread Malcolm Tredinnick
On Wed, 2009-04-08 at 08:43 +0100, Andy Baker wrote: > Wow! So Python will eat RAM until restarted? That changes the way I am > thinking about this problem. Well, that's not really accurate, as you realise further down. The maximum amount of RAM used will not decrease. However, it won't increase

Re: access dict attribute with space in the key

2009-04-08 Thread Malcolm Tredinnick
On Wed, 2009-04-08 at 04:50 -0700, rslee wrote: > I have dict named "servers". With in it, there is a key called "num > of cpu". In Python, I can access this as servers["num of cpu"]. In > Django, how can I access this dict item. I tried the following but > they do not work: {{servers.num of c

Re: Ignore Fixtures or Skip Fixtures

2009-04-08 Thread Russell Keith-Magee
On Thu, Apr 9, 2009 at 12:25 AM, Adam N wrote: > > > > On Apr 8, 11:13 am, Russell Keith-Magee > wrote: >> On Wed, Apr 8, 2009 at 10:27 PM, Adam Nelson wrote: >> >> > Is there any way to ignore fixtures when running syncdb?  I'm using >> > django-command-extensions and when using runscript from

Pass subdomain to a view function.

2009-04-08 Thread Rodrigo C.
Is there a way to catch a subdomain and pass it to a view function? For example, if I have a site "sitename.com", and a user called "user1", I would like to be able to have "user1.sitename.com" be hooked into the user's profile, for example, so I'd need to be able to pass the subdomain to my view

Just a note of thanks to the Django creators

2009-04-08 Thread Tim Chase
Thanks for making Django so clean...I was reading through an article on VB9 allowing "XML Literals" in the code, and couldn't help but think "what a hideous way to bind together code and data. Nothing like requiring a project-rebuild just to alter your template..." An example of this atrocit

Re: Querysets and ROW_NUMBER

2009-04-08 Thread adrian
Thanks for the advice Tim. I ended up doing something similar, although not as elegant as your solution. I'll give it a go ;) cheers adrian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: OperationError: fe_sendauth: no password supplied

2009-04-08 Thread Randy Barlow
LeeRisq wrote: > I have also tried entering a password (same one I use to logon to the > network) in settings.py, but when I do that I get this: > This is almost certainly your problem. You need a username and a password to the database you are using. It sounds like you are trying to use

Running Django admin site using Lighttpd

2009-04-08 Thread Karim Hamdan
Hi all, I have been trying to run my django site using lighttpd rather than using the development server that is shipped with django and I managed to run the site of the project but I failed to run the admin site. Any ideas how I can approach this problem? Thanks. -- Karim Hamdan --~--~---

Re: UserProfile / admin.site.unregister / "'PropertiedClass' object is not iterable" Error

2009-04-08 Thread Karen Tracey
On Wed, Apr 8, 2009 at 5:14 PM, James wrote: > > I'm a bit new to all this. > > I was trying to implement the UserProfile feature described here: > > http://www.thenestedfloat.com/articles/displaying-custom-user-profile-fields-in-djangos-admin > > But when it comes time to add that to the admin s

Re: set default value for combo-boxes in admin interface

2009-04-08 Thread Karen Tracey
On Wed, Apr 8, 2009 at 5:42 PM, Great Kindness wrote: > > I'm just getting started with django. When I'm using the admin > interface to add or edit data, some of the data fields are populated > via drop-down lists. The default for these lists is always ''. How > can I get it to default to a pa

Re: Running Django admin site using Lighttpd

2009-04-08 Thread Karen Tracey
On Wed, Apr 8, 2009 at 8:30 PM, Karim Hamdan wrote: > > Hi all, > > I have been trying to run my django site using lighttpd rather than > using the development server that is shipped with django and I managed > to run the site of the project but I failed to run the admin site. Any > ideas how I c

Re: registration and profile must save at a time

2009-04-08 Thread Malcolm Tredinnick
On Wed, 2009-04-08 at 05:36 -0700, Praveen wrote: [...] > i am very much familiar with django-registration and django-profile > but it really wiered to display extra fields on Registration Form for > that we will have to customize the from django.contrib.auth.forms. I feel you might be over-think

Re: Django Deployment Methods: Survey (via DjangoSites)

2009-04-08 Thread Graham Dumpleton
Is the list of options on the site somewhere where a login isn't required? I had a dig around when you first mentioned this, but couldn't find it. Can you also point at a particular site which has the option selected so can see how it presents in site information? Can one also search by the infor

email attachments

2009-04-08 Thread bradcater
I'm using EmailMessage to send emails upon certain User actions, and I'm getting weird behavior with attachments. Specifically, I'm seeing emails with multiple attachments when there should be no attachments. email = EmailMessage(self.__subject, self.__body, sender, recipients) fo

Re: Many Models, One Form with newforms?

2009-04-08 Thread robstar
Thanks a lot ! That worked great. I can't believe how easy it is to slam everything back into the db using the instance and prefix. Django ftw!! rob > > Just use them all side-by-side in your views and templates,   > potentially using prefixes > (http://docs.djangoproject.com/en/dev/ref/form

Re: How can I filter query sets in a django template?

2009-04-08 Thread codecowboy
Thank you Daniel and Florian (Merci beaucoup. Je parle francais un petit). I think that I will be able to use both templates and custom model methods to accomplish what I am trying. On Apr 5, 4:18 pm, Daniel Roseman wrote: > On Apr 5, 8:49 pm, codecowboy wrote: > > > > > I posted a question

Does anyone know how to prepopulate a form with model data

2009-04-08 Thread codecowboy
I want to create a form that allows a user to edit his/her profile. I don't want to bind my form to a model because the form will involve two different models. Does anyone have any ideas. I've read chapter 7 in the Django Book but it only to a simple example that does not help me. Here is what

Re: ForeignKey to a Base Model and Relationships with the Inherited Models

2009-04-08 Thread Malcolm Tredinnick
On Wed, 2009-04-08 at 08:03 -0700, cfiles wrote: > Is it possible to force a base model to have a sub model? Consider the > following model... > > class Account(models.Model): > user= models.ForeignKey('auth.User') > name= models.CharField(max_length=100) > description

Re: Running Django admin site using Lighttpd

2009-04-08 Thread Karim Hamdan
When I try to access the admin site using "http://localhost/admin"; I get a 404 not found error instead of getting the login page to enter my admin credentials to log in the admin site. -- Karim Hamdan --~--~-~--~~~---~--~~ You received this message because you ar

Re: Help Figuring Out Relationships

2009-04-08 Thread Malcolm Tredinnick
On Wed, 2009-04-08 at 10:37 -0700, PipeManMusic wrote: > I'm working on a project that handles Discography's and I am having > trouble figuring out the relationships. > > Artist: Can belong to more than one Group play more than one Instument/ > Production Role on more than one Album and could var

Re: A long way ...

2009-04-08 Thread Malcolm Tredinnick
On Wed, 2009-04-08 at 12:35 -0700, mettwoch wrote: > Thanks a lot Malcolm! I'll start moving the TurboGears hand-written > admin to the Django admin and keep MySQL. > > I've one more philosophic question: The model in Django should hold > the business rules, right? Not really. Firstly, I'm kind

Aggregates with multiple (conflicting) conditions?

2009-04-08 Thread Adam Seering
Hey, I have a table setup that boils down to something like the following: class MyUser(models.Model): type = models.IntegerField() class MyStuffs(models.Model): stuffs = models.ForeignKey(MyUser) I would like to be able to do something like: MyUser.objects.filt

Re: Details

2009-04-08 Thread zayatzz
ah sorry. I thought that its probably some really small detail that im mssing that i didnt think about posting error. If i take (r'^lang/(?P\d+)/$', 'p2.front.views.changelang'), out of my project urlconf then i just get error when i run language change- go to address that is /lang/number. And th

Re: registration and profile must save at a time

2009-04-08 Thread Praveen
Thank you so much Malcolm but to display extra fields on sign up we will have to customize the django.contric.auth.forms then that form is generated from the user models i am so much confused whether i will have to add extra field in user model class or not but i do not want change the structure o

Re: for loop appending objects

2009-04-08 Thread thedja
Thanks Malcolm, that is just what i needed. :D ..so simple cheers On Apr 7, 10:55 pm, Malcolm Tredinnick wrote: > On Tue, 2009-04-07 at 14:57 -0700, thedja wrote: > > Good day to you all, > > > Im using > > q = Person.objects.filter(pk=query) > > > and i have this inside a FOR statement. So ever

JQuery Autocomplete in Django Not Working

2009-04-08 Thread Gath
Guys, I have the following code from some example i got from here: http://lethain.com/entry/2007/dec/01/using-jquery-django-autocomplete-fields, but its not working on my django application. On my templete i have this function: $(function(){ setAutoComplete("tags", "tagResults", "/taglookup/

Re: Does anyone know how to prepopulate a form with model data

2009-04-08 Thread Briel
Hi. It seems like your error and your problem is not the same. The error is complaining about the get_object_or_404, not the profile thing. So changing that code won't actually do anything as it doesn't get that far. ~Jakob On Apr 9, 3:55 am, codecowboy wrote: > I want to create a form that all

Re: registration and profile must save at a time

2009-04-08 Thread James Bennett
On Thu, Apr 9, 2009 at 12:27 AM, Praveen wrote: > Thank you so much Malcolm but to display extra fields on sign up we > will have to customize the django.contric.auth.forms then that form is > generated from the user models i am so much confused whether i will > have to add extra field in user mo

Help! PNG file upload error...

2009-04-08 Thread higer
When I upload a PNG file and use PIL to handle it,there will be an error occured: 'NoneType' object is unsubscriptable I do not know why and other formats(BMP GIF JPG JPEG) are all ok. The following is my code in my views.py: f = request.FILES["imagefile"] fileExt = (f.name).split(".")[-1].lowe

Re: Help! PNG file upload error...

2009-04-08 Thread Kushal Das
On Thu, Apr 9, 2009 at 11:15 AM, higer wrote: > > When I upload a PNG file and use PIL to handle it,there will be an > error occured: > 'NoneType' object is unsubscriptable > > I do not know why and other formats(BMP GIF JPG JPEG) are all ok. > The following is  my code in my views.py: > > f = re