Re: Order By Calculated Value??

2007-12-06 Thread RajeshD
On Dec 5, 5:17 pm, "Tane Piper" <[EMAIL PROTECTED]> wrote: > Here is my blog application, which contains the two models: Thanks. So, as I said in the post above, Entry.save() override won't work with your M2M categories. That's because the M2M objects are saved only after the Entry is saved

Re: Order By Calculated Value??

2007-12-06 Thread RajeshD
Hi Darryl and Tane, > > [untested with Many2Many, but should work, it works for ForeignKeys] Actually, the approach below won't work for M2M even though it does for FKs. > In your Entry save() method call the save method of each of your related > categories after you do your super().save() > >

Re: Order By Calculated Value??

2007-12-05 Thread RajeshD
> > Hope that makes sense, as if I can do it this way instead of > calculating it on the view, that would make this inclusion tag so much > easier. What does your Entry model look like? --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Problems saving values from SelectDateWidget

2007-12-05 Thread RajeshD
On Dec 5, 10:31 am, Stupid Dustbin <[EMAIL PROTECTED]> wrote: > Thanks for the reply. However, after updating to the latest SVN > version of django. The same error still occurs. :( I am using the same constructs with Django rev #6652 in production. Perhaps you want to downgrade to that

Re: dynamic newforms validation etc

2007-11-30 Thread RajeshD
> This data needs to be saved in Options. A record for each product > selected with the name and price in it. This is because the product > name can change in the future and the price can change. So this should > be stored in Options. > > My problem is that I don't know yet how to do this. > >

Re: Problems saving values from SelectDateWidget

2007-11-30 Thread RajeshD
On Nov 29, 4:51 am, Stupid Dustbin <[EMAIL PROTECTED]> wrote: > Hi, encountered a problem recently with SelectDateWidget. I'm not very > sure what I did wrong. Your usage of that widget is correct. Note that a recent Django revision (the excellent "autoescape" feature) had introduced a bug

Re: How to make such query with django ORM?

2007-11-30 Thread RajeshD
> > I need to get all blogs that belong to certain user and are empty (do > not have any articles). I can't figure out how to make it with without > extra() method. As others have recommended, just use the extra() method. It's not so bad :) If you really really want to avoid that, you could add

Re: Use of newforms prefixes in html templates

2007-11-30 Thread RajeshD
> > I have a list of forms that I want to pass to my template but I am not > sure how to include the prefix. When you are creating each instance of your form, just specify the appropriate prefix for it: form = MyForm(prefix='my-prefix') When you render this form instance, Django will include

Re: Access urls in template tags?

2007-11-30 Thread RajeshD
> Is there a simple way to do this within the template tag or would I > need to create a context processor and would this be available within > the templatetag or only within the template itself? You can do this inside a template tag. Assuming that you already have the request available in your

Re: question about list_display

2007-11-21 Thread RajeshD
> > It is about how to use color in list_display. > When i use it, I didn't correctly get the colored field of > first_name. > Only get strings like '%s' in this > field. > Is there anything I misunderstand to make it work correctly? Your use of "allow_tags" looks good. A recent release of

Re: generic views and form templates

2007-11-21 Thread RajeshD
> that work ok, when a user want to create an entry it opens > komentar_form.html and it's displayed right. but when user clicks > submit, it always returns a error for slug field. since user doesn't > write slug field (should be prepopulated, right?), No. That only happens in the admin and even

Re: Permissions and user.has_perm

2007-11-21 Thread RajeshD
> > >>> u.has_perm("person.add_person") > False What's your app_label (usually the lowercase name of the app whose models.py contains your Person class")? The has_perm method should be called with .add_person and not with .add_person

Re: Complicated question

2007-11-20 Thread RajeshD
> > That's interesting, but I think that leaving the models untouched > would be better. > Do you think there is a different way? There might be. First, you'd have to explain what you didn't like about doing queries like: Image.objects.filter( book__library_owner=request.user) Since you don't

Re: local dev them publish out to the real world

2007-11-20 Thread RajeshD
> hey I am new to django? Welcome. > so is it possable to devlop a django site on my mac and then publish > to another webserver or EC2/S3 Yes, not only is it possible but it happens to be the most common case: develop on your workstation (Mac, Windows, Linux, doesn't matter) and then push to

Re: Complicated question

2007-11-20 Thread RajeshD
>From what I understand, you want a generic ability to declare an owner item for any model object. Django's generic relations work that way. Take a look at the examples here: http://www.djangoproject.com/documentation/models/generic_relations/ Specially, instead of TaggedItem in that example,

Re: prepopulate_from delimiter

2007-11-20 Thread RajeshD
On Nov 20, 1:11 am, Mogga <[EMAIL PROTECTED]> wrote: > great article... very interesting and answered some old questions... > not using it for URLS... > i'm developing some file system mgmt tools for software packages that > don't like hyphens. i'll have to hack the slugifier or create my own >

Re: using "select_related" .Does it works?

2007-11-20 Thread RajeshD
> The docs say select_related() does not follow foreign keys that have > null=True. In your example it would do nothing. > It would. As Samuel points out, select_related's only job is to save you some database trips. The examples I cooked up above will work fine with or without select_related().

Re: Problem with date based list_filter in django admin

2007-11-19 Thread RajeshD
> Does this have something to do with the autoescape revisions that were > just put out? I'm working off of the latest revision if that's of any > help. Thanks. It's likely. If you've the time, perhaps revert to a revision just prior to when the autoescape changes were committed and report

Re: prepopulate_from delimiter

2007-11-19 Thread RajeshD
> is it possible to specify a custom delimeter for the prepopulate_from > option for slugfields? ie. underscore instead of hyphen? > thanks in advance!! The delimiter is part of a hardcoded regular expression used by the "slugifier" Javascript. So, it's not customizable short of providing your

Re: using "select_related" .Does it works?

2007-11-19 Thread RajeshD
> > I just want to make a join through this tables with the select_related > to be able to print Image.name, Instrument.name, Channel.name Your query would be something like this: images = Image.objects.select_related() You can use this query set in your templates or in Python: Template

Re: validating fields with newforms

2007-11-19 Thread RajeshD
> I would like to validate a field if another field is defined. So i > have two fields (state and state (international) ) -- one of them > needs to be defined. How would i do this with newforms? By adding a clean() method to your form class. See the 3rd cleaning method described here:

Re: add/change user via 'Admin'

2007-11-19 Thread RajeshD
On Nov 19, 12:25 pm, Nader <[EMAIL PROTECTED]> wrote: > I have done it: 'python manage.py syncdb' and started the server. I > have got the same error as before. It seems that your content types and permissions got messed up somehow. See this thread for a discussion of a similar problem with

Re: add/change user via 'Admin'

2007-11-19 Thread RajeshD
On Nov 19, 11:14 am, Nader <[EMAIL PROTECTED]> wrote: > I use the 'Admin' class in my project to do administration of > applications. For the user I have defined a 'admin' and the other > user. If I go to the 'user' page and want to do something with the > 'admin' user and with the other user,

Re: save() doesn't save a removed parent-child relationship to self?

2007-11-19 Thread RajeshD
> > The print self.parents.all() line does print a [] line with self > removed from the parents. Apparently this just does not get saved. Right. The admin always calls the save on the primary object first, followed later by saving the ManyToMany "parents". So, whatever you are doing in your

Re: Questions about css in templates

2007-11-15 Thread RajeshD
> > MEDIA_ROOT = 'C:/Documents and Settings/Nserc2/My Documents/ > mytemplates/media' > > > MEDIA_URL = /mymedia/ > > You also mentioned to activate the appropriate context processor. I > didn't have any TEMPLATE_CONTEXT_PROCESSOR in my settings file to > begin with so I added the lines: > >

Re: Method 'allow_tags' doesn't work?

2007-11-15 Thread RajeshD
On Nov 15, 2:34 pm, wowar <[EMAIL PROTECTED]> wrote: > Today, after updating django to revision 6678 method 'allow_tags' > doesn't work. Despite it is set to True I've got html code. If it used to work previously, this may have to do with the auto- escaping code commit from revision 6671. See

Re: No module named views

2007-11-15 Thread RajeshD
Since the error you are seeing is in 'project.app.urls' and the error says "No module named views", it seems that the statement that's failing in / project/app/urls is this one: from voting.views import vote_on_object This would mean that voting.views is not a valid Python module: 1. Is there

Re: Deploying Django

2007-11-15 Thread RajeshD
> Well, just to know. What are you using? This should also be useful for > my "little" project, the django deployer, still unnamed. I've been using Lighttpd + FCGI on Joyent containers (my favorite production deployment enviroment). In my setups, the Lighty/FCGI combo seems to use server memory

Re: Questions about css in templates

2007-11-15 Thread RajeshD
On Nov 15, 6:54 pm, Chris Rich <[EMAIL PROTECTED]> wrote: > Ok, > I just got it to work by using the {% include %} tag. Is this a > fine way to include css stuff or should I not use this for some > reason? Unless your CSS is very short, you should not use this technique because it inserts

Re: No module named views

2007-11-15 Thread RajeshD
> > I'm sorry for this long paste.. i could you dpaste. > thanks, martin Yes, it's probably better to dpaste it when you have a lot of code like that. That way, your indentation is preserved and it's easier for others to review your code. I should've recommended it when I asked you to paste

Re: Simple save() override not working

2007-11-15 Thread RajeshD
On Nov 13, 3:36 pm, "Mike Feldmeier" <[EMAIL PROTECTED]> wrote: > I know, I've seen a million posts about this, but they all seem to relate to > m2m fields. While I do have an m2m field in the table (blog entry <-> > tags), it's one of the simple fields I'm having trouble with. > > def

Re: Questions about css in templates

2007-11-15 Thread RajeshD
> > > ...but it doesnt like that. I've tried typing in the full path name > and that doesn't seem to work either. You need to define "doesn't seem to work" more clearly. For example, if you request that stylesheet URL from your browser's URL bar, does the stylesheet come up? Also, serving of

Re: Flat return list from MultipleChoiceField

2007-11-15 Thread RajeshD
> > When there is more than one form B, the posted data for the 'b' field > is flattened. Are the input fields of your two form B's being presented inside one HTML tag? If the answer is yes *and* if the two multiple choice fields have the same "name", then your browser will post all their

Re: custom forms, models and django 0.96

2007-11-09 Thread RajeshD
On Nov 9, 12:37 pm, schlam <[EMAIL PROTECTED]> wrote: > I am a developing in django 0.96 and therefor don't have the option to > use form_for_model with fields, so having developed a custom form to > add users to the database am experiencing minor problems with model > validation. > so my form

Re: German dates (with date filter)

2007-11-09 Thread RajeshD
On Nov 9, 8:12 am, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > I use this line in my template: > > geschrieben am {{ entry.creationDate|date:"D, j.n.y, H:i" }} > > (geschrieben am == writen at) > > It produces output like "Wed, 26.9.07, 16:49" > > is there any way I can make this

Re: strange custome sql

2007-11-09 Thread RajeshD
> > 1. cursor.execute( "insert into popo_status( id , author_id , body , > type ) VALUES (NULL , '1', body, '1') ") > no error, but insert nothing Try committing after that statement: connection.commit() > > 2. cursor.execute( "select * from popo_status where id=21 ") > no error, but ok > >

Re: "You don't have permission to access /doc/lookup/ on this server."

2007-11-09 Thread RajeshD
> > "You don't have permission to access /doc/lookup/ on this server." > > Note that /doc/lookup/ is a URL, not a folder, so there are no > permissions to set. I'm wondering if /doc might mean something special > to Apache? If not then any other ideas? > > My Apache2.conf can be viewed

Re: Will there be a django 0.97 release ?

2007-11-08 Thread RajeshD
> as far as i understand it, django applications are ment to be > pluggable.. how big are the odds that you'll find two applications > which would work with the same django trunk revision ? I didn't mean that your app would stop working at all on any other revisions. Just that you can

Re: Best Django Blogs

2007-11-08 Thread RajeshD
A lot of the Blogs on the community aggregator are worth following. To me, the B-List deserves a special mention for its valuable tips and tricks -- it's invaluable to newbies, and often has insightful write ups for the seasoned users as well. Thanks, James!

Re: context_instance needs documenting on the same page as render_to_response?

2007-11-08 Thread RajeshD
> This page doesn't even show up on the first page of results so it > isn't surprising people miss it. Worth adding a mention to the docs? Worth opening a ticket too :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Multiple arguments to a template filter

2007-11-08 Thread RajeshD
On Nov 8, 4:49 pm, jim <[EMAIL PROTECTED]> wrote: > I am writing some custom template filters. How does one transmit > multiple arguments to a filter. eg. > > {{ form.errors|dynamicformfield:"pass",1,"firstname" }} > > my dynamicformfield filter has the following signature: > > def

Re: Will there be a django 0.97 release ?

2007-11-08 Thread RajeshD
> > So are there any plans on releasing a 0.97 ? I hope you understand my > concerns - django is really great and the trunk is stable but I understand the concern, but how does having a 0.97 release change this for you? There would still be potentially backwards-incompatible changes moving

Re: Problem with "auto_now_add" in Admin interface

2007-11-08 Thread RajeshD
On Nov 8, 2:17 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > Here's a ticket that looks like it describes your problem: > > http://code.djangoproject.com/ticket/1030 > > It's still open but it looks like the last comment might provide a > workaround, depending on the version of Django you are

Re: AUTH_PROFILE_MODULE usable with v0.96?

2007-11-07 Thread RajeshD
On Nov 7, 6:46 am, paulc <[EMAIL PROTECTED]> wrote: > I'm trying to follow the example in the Django book, to make a simple > extension of the standard User object. > > I'm hoping someone may be able to give me a quick yes or no on this: > is the AUTH_PROFILE_MODULE setting expected to work

Re: site is built with django, but my server doesn't know that...

2007-11-07 Thread RajeshD
> Here is what I do and > what it all looks like: > > log in as [EMAIL PROTECTED] > > [EMAIL PROTECTED]:~# python > Python 2.5.1, Ubuntu 4.1.2 etc. etc. > > So Python is installed and I've opened the interpreter, right? > > Then this: > > >>> import django [to verify that django is installed] > >

Re: Does anyone know a good method for creating one time pages with Django?

2007-11-07 Thread RajeshD
On Nov 7, 10:11 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Thanks, flat pages look really useful. > > Unfortunately I don't think they solve my problem here - the rest of > the page needs to be dynamic and driven by custom content; it's only a > subset of the page elements that I want

Re: form_for_instance and form argument, empty form?

2007-11-07 Thread RajeshD
> > > Paste here your FooForm and Foo model code that doesn't work for you. > > class Foo(models.Model): > title = models.CharField(_("Title"), core=True, maxlength=100) > > class FooForm(forms.Form): > title = forms.CharField(label = _("Title")) Now, I am more confused about your actual

Re: form_for_instance and form argument, empty form?

2007-11-07 Thread RajeshD
On Nov 7, 9:42 am, David Larlet <[EMAIL PROTECTED]> wrote: > I thought that it was more appropriated to post it on the devlist > because it sounds like a bug but ok let's move it on the userlist, sorry > for the noise here. I'll be glad to hear your solution. Paste here your FooForm and Foo

Re: Does anyone know a good method for creating one time pages with Django?

2007-11-07 Thread RajeshD
> However this seems messy > and I feel like I'm working against Django. Is there a better way of > doing it? Consider using "flatpages": http://www.djangoproject.com/documentation/flatpages/ --~--~-~--~~~---~--~~ You received this message because you are

Re: permissions on media files

2007-11-03 Thread RajeshD
> So is my only solution to read and serve the file > using django ? Or is there a mod_python extension that can do this > more efficiently ? Perhaps Amazon S3 would serve your needs? http://www.amazon.com/gp/browse.html?node=16427261 --~--~-~--~~~---~--~~ You

Re: Newforms validation error not displayed:

2007-11-03 Thread RajeshD
> > def clean_guess_the_number(self): > if self.max_number > self.cleaned_data['guess_the_number']: Change that to: if self.max_number < self.cleaned_data['guess_the_number']: > raise forms.ValidationError('Your Number have to be lower > or equal to Max Number.') >

Re: encoding problem in instance signal / dispatcher?

2007-11-03 Thread RajeshD
Take a look at your Tag model's __unicode__ method (or paste your Tag model here). I suspect that's where the problem is. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: i18n and choices from database

2007-11-03 Thread RajeshD
> Question is how to show query from database on template with localized > output Try this in your template (assuming p is a person model instance available to your template): {{ p.get_gender_display }} See: http://www.djangoproject.com/documentation/db-api/#get-foo-display Also, another

Re: Is there a simpler solution?

2007-11-02 Thread RajeshD
Disregard the overflow:hidden piece in my CSS above. It's not needed: .article {width:32%;float:left;} .clear_all {clear:both;} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Is there a simpler solution?

2007-11-02 Thread RajeshD
On Nov 2, 4:05 pm, "Ramdas S" <[EMAIL PROTECTED]> wrote: > Hi, > > I am sure there is something absolutely simple, but I guess I am missing it. > I need to display some content/ news articles over 3 columns on a home page, > where the order is latest stories coming in top rows from left to

Re: Limiting Foreign Key choices to members of a certain group using generic views

2007-11-02 Thread RajeshD
> > # run with this form following the examples in the newforms > documentations. You can also change the domain "choices" after the form class is created for you by modifying the form class's base_fields as I see you have done in your post in another thread here:

Re: Limiting Foreign Key choices to members of a certain group using generic views

2007-11-02 Thread RajeshD
On Nov 2, 4:02 pm, rm <[EMAIL PROTECTED]> wrote: > On Nov 2, 3:54 pm, RajeshD <[EMAIL PROTECTED]> wrote: > > > When you acquire a Customer newform instance in your view, you will be > > able to modify the choices attribute of its domain field so that these > &g

Re: Displaying error messages if form data not valid

2007-11-02 Thread RajeshD
On Nov 2, 12:08 pm, jim <[EMAIL PROTECTED]> wrote: > OK. This approach works. Thanks. > > Would you have any link to a best practice where such a approach is > detailed? The very first simple view example in the New forms documentation shows what Malcolm recommended to you.

Re: template question

2007-11-02 Thread RajeshD
On Nov 1, 9:56 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have this code in my view, for example: > > a=['a','b','c'] # a list of row labels > b=[1,2,3] # a list of col label > c=tab # an array (list of list) with len(a) rows and len(b) cols. If c[i, j] previously had a value of x,

Re: Standard place for signal processing code?

2007-11-02 Thread RajeshD
> I'm looking for a hint as to where put signal processing code. Various > objects in many apps in my project emit one signal, that has to be > processed in single place and is not directly related to any particular > app nor object. I do not want it in any app, since apps can be turned on > and

Re: Django newbie, URL resloving problem

2007-11-01 Thread RajeshD
On Nov 1, 7:26 am, gizmo <[EMAIL PROTECTED]> wrote: > Hello, > I started learning about Django and I followed an example > athttp://www.djangobook.com/en/beta/chapter03/ > > I've done: > from django.conf.urls.defaults import * > from gizmo_site.datetime import current_datetime This suggests

Re: using newforms, an uncommon case.

2007-10-30 Thread RajeshD
Here's a different approach: You could serialize an incomplete form instance to another table (could just be serialized to the user's session too.) Then, when the user requests to continue filling out an incomplete form, just deserialize the form instance and you have the form exactly as the

Re: bypassing reverse relation (related_name)

2007-10-17 Thread RajeshD
> > Is there a way to express that I don't need the reverse relation? No. Even if you don't need them, Django will want to dynamically endow your Location objects with them. And, as you know, it can't do it if two reverse relations have the same name.

Re: Custom Managers and Model Methods

2007-10-17 Thread RajeshD
Hi Jason, > Using the models below I'd like to be able to create Querysets such as: > > a = Treatment.objects.filter(total_dose__range=(4000,1)) > b = a.filter(tumor__patient__gender = 'M') > > Both of the above work, but then I'd like to have an additional filter: > c =

Re: newform: Why Doesn't This work

2007-10-17 Thread RajeshD
Aaargh...the indentation got screwed up. Here's another attempt: class myForm(forms.Form): def __init__(self, *args, **kwargs): self.q_prime = [] # default choices here? try: self.q_prime = kwargs.pop('q') except: pass super(myForm,

Re: newform: Why Doesn't This work

2007-10-17 Thread RajeshD
class myForm(forms.Form): def __init__(self, *args, **kwargs): try: self.q_prime = kwargs.pop('q') except: pass super(myForm, self).__init__(*args, **kwargs) choice = forms.ChoiceField(label="My choice",

Re: problem in uploading image

2007-10-16 Thread RajeshD
> > if form.is_valid(): > clean_data = form.clean_data > t = Image If Image is a model class, the above should read: t = Image() > > but it is showing an error saying 'module' object has no > attribute 'save_photo_file'

Re: Fastcgi always gives 301

2007-10-15 Thread RajeshD
On Oct 15, 10:23 am, maqr <[EMAIL PROTECTED]> wrote: > Does anyone have any suggestions as to why this 301 MOVED PERMANENTLY > is the only response I can get out of my FCGI script? Did you follow the official FCGI docs over here? http://www.djangoproject.com/documentation/fastcgi/

Re: select choices

2007-10-15 Thread RajeshD
> > Arn't stings slower against integers? You can always set db_index=True on the type field if you'll be using it a lot in your lookups and if the number of records in that table is going to be huge. http://www.djangoproject.com/documentation/model-api/#db-index

Re: Multiple app environments on the same machine - settings & more

2007-10-15 Thread RajeshD
> The idea is I would like to set up a production (prod) and pre- > production (preprod) and have preprod updated and unit tests run > everytime I commit changes to the SVN repo from my local machine (this > can be easily done with svn-hooks). > > No problems so far, however what worries me is

Re: select choices

2007-10-15 Thread RajeshD
> Does anybody know a more easy way? Any particular reason you have to have type as an IntegerField? If you had it as a CharField, you could do: TYPE = (('foo', 'foo'), ('BAR', 'BAR')) type = models.CharField(choices=TYPE) Foo.objects.filter(type='BAR') And, possibly add db_index=True to the

Re: newforms problems

2007-10-15 Thread RajeshD
> 1) pass_matched always return False > how can i compare two fields in my class??? def pass_matched(self): if self.fields['pass'] == self.fields['repass']: return True else: return False 1. use self.cleaned_data instead of self.fields 2. call

Re: Accessing many-to-many relations in save()

2007-10-12 Thread RajeshD
> Sure. I'm trying to set a boolean property on the object based on the > existence (or absence) of a ManyToMany relationship. So I originally > thought something like: > > def save(self): > self.has_m2m_thing = bool(self.m2m_relation.count()) > super(MyModel, self).save() > > This works

Re: Accessing many-to-many relations in save()

2007-10-12 Thread RajeshD
On Oct 11, 6:54 pm, Adam Endicott <[EMAIL PROTECTED]> wrote: > I've got an app where I'd like to set some properties in an object's > save method based on ManyToMany relationships. Can you describe generally what you are trying to update in the parent object when its ManyToMany relationships

Re: Possible ifequal and/or ifnotequal bug

2007-10-12 Thread RajeshD
> > The above code is NOT catching the first instance of an NAICS > description which begins with "A". The filter on the first parameter there won't work (as you've already discovered.) 1. If you are using Django SVN trunk, try assigning that filtered value first to a variable using the 'with'

Re: Signals error - I can't do a import

2007-10-11 Thread RajeshD
Perhaps try the import this way: // sig.py def thesignal(sender, instance, signal, *args, **kwargs): from mysite.plush.models import Photo assert False, "It got here" // --~--~-~--~~~---~--~~ You received this message

Re: Random objects in view

2007-10-04 Thread RajeshD
Hi Alessandro, Replace: items.filter(provincia__iexact=provincia) with items = items.filter(provincia__iexact=provincia) Similarly, replace items.filter(tipo__iexact=tipo) with items = items.filter(tipo__iexact=tipo) Remember that whenever you filter an existing queryset in order to

Re: sharing django on production and dev

2007-09-28 Thread RajeshD
Hi, On Sep 28, 1:46 pm, Milan Andric <[EMAIL PROTECTED]> wrote: > Is there some standard practice on a machine that has production code > running in mod_python but also has developers running their django- > python web server? Is that discouraged? Yes absolutely discouraged. The standard

Re: Signals not working correctly

2007-09-13 Thread RajeshD
On Sep 13, 11:13 am, Greg <[EMAIL PROTECTED]> wrote: > Hello, > I'm trying to use signals so that when a Publication gets deleted from > within the Admin it will 'assert False, "Here"' (This will obviously > change at a later date). Currently, when I delete a Publication (in > the django

Re: form_for_instance + user profile

2007-09-12 Thread RajeshD
> > Basic example: > > user = User.objects.get(id=1) > user_profile = user.get_profile() This should work if you have settings.AUTH_PROFILE_MODULE pointing to your UserProfile model. See: http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/

Re: django-voting question

2007-09-12 Thread RajeshD
> > Problem is, I can't manage to do anything with posts in my template. What exactly are you trying to do that's not working? > When I view source, I see an object reference, so I know it's getting > there, and I know this is probably a terribly dumb question, but how > do I access posts? How

Re: Decoupling templates

2007-09-12 Thread RajeshD
> How can I decouple my templates to an app specific directoy? The way that my > apps are self contained also regarding their templates? That feature is built in to Django. Create a templates sub-directory in your app directory and place your app specific templates in there. Look at the the

Re: data manipulation in templates or views?

2007-09-07 Thread RajeshD
> I hope I am not inviting a quasi-religious war > on this issue, but I am wonder if people could provide some insight on > when or why I should do this sort of thing within the template (via > template tag or not) or if I should continue doing that within the > view, which not only currently

Re: User Administration

2007-09-07 Thread RajeshD
> > please have a method to add one user to a specific group? Try this: grp = Group.objects.get(name='registered') us.groups.add(grp) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: hidden fields

2007-09-07 Thread RajeshD
On Sep 7, 9:55 am, Ana <[EMAIL PROTECTED]> wrote: > Hi, > I'd like to have "last modified by" and "owner" fields in my > application. I'd like to set fields value automatically, and I want > those fields to be hidden. Is there any way I can do that? Yes. Here's one way to do it: Add those

Re: Storing Lookup Data

2007-09-06 Thread RajeshD
> > It seems like the Choice table is easier on the user. You tell them > to go to the Choices table to enter all the look-up data, as opposed > to giving them X tables to wade through. As you said, it is probably a DB design question -- even within a single project, you might need to use both

Re: using querysets to populate a form

2007-09-06 Thread RajeshD
> I have a requirement to use querysets as choices in various elements > of a form, and as the data grows this is clearly going to have a big > hit on the database every time this form is loaded. Can anyone think > of a way around this? Is there a way to cache the query set and only >

Re: unique_true option of the fields works as case-sensitive, how can we make it case-insensitive?

2007-09-06 Thread RajeshD
On Sep 4, 9:28 am, parabol <[EMAIL PROTECTED]> wrote: > When I mark a field as unique_true is works as case-sensitive and does > not catch something like "problem" and "Problem". What is the correct > way of making it case-insensitive? Thus it will catch even "problem" > and "ProBLem". > > I

Re: overriding save, non-admin error

2007-09-06 Thread RajeshD
On Sep 4, 7:18 am, canburak <[EMAIL PROTECTED]> wrote: > I have a problem on overriding the save() method. > my new save is: > class ClassName: > def save(self): > self.title = self.title.title() > super(ClassName, self).save() > > when admin site uses this save(), I get the

Re: Custom template tags within a textarea field

2007-09-06 Thread RajeshD
On Sep 5, 12:03 pm, MichaelMartinides <[EMAIL PROTECTED]> wrote: > Hi, > > Just to be sure. > > If I have custom template tags within a TextAreafield of a model. I > would do something like to following: > > def view(request, page): > p = Page.objects.get(name=page) > t = Template(

Re: Translating strings with placeholder in template

2007-09-06 Thread RajeshD
> I think this would work with Python code. However, can I do the > translation in Django's Template language? If so, how? See blocktrans: http://www.djangoproject.com/documentation/i18n/#in-template-code In short, you would use: {% blocktrans %}login.before.you.proceed {{ login_url }}{%

Re: forms, views and foreign key

2007-09-06 Thread RajeshD
> -- > so.. the problem is: > > Request Method: GET > Request URL:http://127.0.0.1:8000/profile/ > Exception Type: AttributeError > Exception Value:'Profile' object has no attribute 'get' > > what's wrong? :( > What line of

Re: Multi page article

2007-08-29 Thread RajeshD
I would second Michael's suggestion to use a page break marker. I have used that in many instances with great succcess -- your content admins will thank you :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: site/section/app

2007-08-29 Thread RajeshD
1. You could use a GenericForeignKey in your 'App' model: http://www.djangoproject.com/documentation/models/generic_relations/ Quote: "Generic relations let an object have a foreign key to any object through a content-type/object-id field. A generic foreign key can point to any object, be it

Re: queryset cache

2007-08-22 Thread RajeshD
On Aug 22, 10:21 am, sean <[EMAIL PROTECTED]> wrote: > That's the problem, I don't know how to cache the queryset. > But for what it's worth, here's something i tried. I tried to take > advantage of the default caching of querysets, but that doesn't work > here. > > mediaform = CustomMediaForm

Re: queryset cache

2007-08-22 Thread RajeshD
On Aug 22, 8:08 am, sean <[EMAIL PROTECTED]> wrote: > Hi all, > I'm running into a performance problem with some pages i created. The > page has multiple forms, which are all the same, with the exception of > the initial data (it's a kind of batch insert functionality), but all > foreign keys

Re: In-line Comments

2007-08-21 Thread RajeshD
> So the question is, if anybody is aware of an in-line comment system > we could use or build upon, otherwise I guess I'll try and do > something myself. A good starting point: http://www.jackslocum.com/blog/2006/10/09/my-wordpress-comments-system-built-with-yahoo-ui-and-yahooext/

Re: quiz design

2007-08-21 Thread RajeshD
On Aug 19, 10:40 pm, "Ramdas S" <[EMAIL PROTECTED]> wrote: > Hi, > > Has anyone worked on a quiz/ multiple choice contest design using Django > using Newforms? Yes. http://popteen.com/feature/view/style/looks/what-s-your-sunbathing-style-/

Re: FileField: changing file names

2007-08-21 Thread RajeshD
> dscn0001___.jpg > dscn0001.jpg > dscn0001_.jpg > > I could override the save() method to save the files under / > , but that would make the get_FOO_url and others fail. No it won't. As long as your ImageField ends up pointing to the correct relative path of your renamed

Re: Odd 404 error on Textdrive with Lighty

2007-08-20 Thread RajeshD
On Aug 20, 7:53 pm, "David Merwin" <[EMAIL PROTECTED]> wrote: > http://stpaulswired.org/media/audio/2007/aug/05/straight-from-t/is > teh main one and then derivitaves of the same: > > http://stpaulswired.org/media/audio/2007/aug/05/http://stpaulswired.org/media/audio/2007/aug/ > > Thanks so

  1   2   3   >