Re: Common prefix shortcuts problem

2007-12-23 Thread kadavy
This magically began working - I swear. --~--~-~--~~~---~--~~ 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

Common prefix shortcuts problem

2007-12-23 Thread kadavy
I am going through the tutorial 3 for the SVN version: http://www.djangoproject.com/documentation/tutorial03/ And everything works fine until I get to "Decoupling the URLconfs. Here are what my urls.py files look like: # Installation-specific urls.py from django.conf.urls.defaults import *

Re: How to initialize M2M field in new ModelForm?

2007-12-23 Thread Yatla
Well, I tried the initial arguement again, and it worked this time...must have made a typo the other time I tried this. Thx On Dec 23, 2:03 pm, Yatla <[EMAIL PROTECTED]> wrote: > Joseph, > > Yes, for a new Document, I want to assign to an existing Category. > The initial arguement works for a

newforms-admin, modelforms: extending forms

2007-12-23 Thread Michel Thadeu Sabchuk
Hi guys, I'm trying to extend a ModelForm, I had success but I must redefine the Meta class, it doesn't got extended. Is this a bug? See the following code: class Form1(forms.ModelAdmin): class Meta: model = SomeType class Form2(Form1): extra_field =

Using extjs with ModelForms

2007-12-23 Thread nanbudh
Hi, I am building a app which generates a large Form based upon a combination of many ModelForms. These ModelForms are doing precious work of filling out drop down lists of the foriegn fields of dependent models. ModelForms also ensures that my form is always in sync with my models.py. I want to

Re: noob question - Feedparser / Template_Utils / time filters

2007-12-23 Thread [EMAIL PROTECTED]
Gotta say - a week into this project - I am loving Django. Wrote a small custom filter: @register.filter ("fromdatetuple") def fromdatetuple(value): return datetime.datetime.fromtimestamp(time.mktime(value)) fromdatetuple.is_safe = True And added this to the template: {{

Re: Tutorial 2 admin Template not found

2007-12-23 Thread kadavy
Thanks, everyone, Jeff, I installed the SVN version, like you said - and it worked! I guess I was under the (apparently false) impression that the official release would be better to install than the SVN version. On Dec 22, 3:47 am, Jeff Anderson <[EMAIL PROTECTED]> wrote: > I have no problems

ModelForm, ImageField and User

2007-12-23 Thread l5x
class Photo(models.Model): user = models.ForeignKey(User) main = models.BooleanField(_('Is main?')) icon = models.ImageField(_('Icon'), upload_to='photo', null=True, blank=True, help_text=_('Don\'t touch! It will be generated automatically')) medium =

Re: Run different django versions

2007-12-23 Thread guoqiang qian
you can add import sys sys.path.insert(0, '/your/django-svn/path') in the 2 line of manage.py file. 2007/12/24, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > > > Hi i have 2 projects which one of them uses the svn version of the django > and > another uses 0.96.1 > > How should i handle that

Re: Run different django versions

2007-12-23 Thread Graham Dumpleton
On Dec 24, 9:36 am, [EMAIL PROTECTED] wrote: > Hi i have 2 projects which one of them uses the svn version of the django and > another uses 0.96.1 > > How should i handle that situation. Currently i checouted the svn version and > created a ln -s to my site-packages version? > > How can i have

Run different django versions

2007-12-23 Thread makkalot
Hi i have 2 projects which one of them uses the svn version of the django and another uses 0.96.1 How should i handle that situation. Currently i checouted the svn version and created a ln -s to my site-packages version? How can i have the 0.96.1 when i work with my site and to have svn when

Re: 'User' object has no attribute 'get'

2007-12-23 Thread Alex Koshelev
What is UserForm? On 24 дек, 00:46, l5x <[EMAIL PROTECTED]> wrote: > Traceback: > File "/home/user/django_src/django/template/debug.py" in render_node > 71. result = node.render(context) > File "/home/user/django_src/django/template/debug.py" in render > 87. output =

Re: 'User' object has no attribute 'get'

2007-12-23 Thread l5x
I think I missed: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#ModelFormsconstructornowmatchesForms That should be the solution! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

'User' object has no attribute 'get'

2007-12-23 Thread l5x
Traceback: File "/home/user/django_src/django/template/debug.py" in render_node 71. result = node.render(context) File "/home/user/django_src/django/template/debug.py" in render 87. output = force_unicode(self.filter_expression.resolve(context)) File

Re: Making a front end administration

2007-12-23 Thread Antoni Aloy
2007/12/23, tjunning <[EMAIL PROTECTED]>: > > Hi, > > I'm really, part time app devleoper and very new with Python & Django, > I was wondering is there a way to use the django administration > interface as the main app? and plug the rest of the app as part of it? > Basically I want my application

Re: is there any way to avoid restart apache when changed django code to see the modification

2007-12-23 Thread Graham Dumpleton
Or use daemon mode of mod_wsgi 2.0 instead and enable process reload mechanism. This way all you need to do is touch the WSGI script file for the Django application and the daemon process for just Django will be restarted automatically without the need to restart the whole of Apache. Daemon

Re: noob question - Feedparser / Template_Utils / time filters

2007-12-23 Thread [EMAIL PROTECTED]
James thanks. I have been reviewing the Python docs but there are too many moving parts for me at this point. I assume this can be accomplished within the feeds.py module fairly simply but I am just beginning to learn the code. I will give it a shot once I have a bit more experience with it.

Re: (Newbie) TemplateSyntaxError in admin panel

2007-12-23 Thread Karen Tracey
On Dec 23, 2007 1:50 PM, Rex Eastbourne <[EMAIL PROTECTED]> wrote: > > Hi, > > Is there any solution to the below described problem? I still haven't > been able to get it to work. > > Best, > Rex > Somehow it seems you have gotten recent templates from SVN mixed in with code from 0.96. Details

Re: How to initialize M2M field in new ModelForm?

2007-12-23 Thread Yatla
Joseph, Yes, for a new Document, I want to assign to an existing Category. The initial arguement works for a form class, which is what I first had, but then modified to use the new ModelForm class. The ModelForm class does not seem to accept an initial arguement. On Dec 22, 5:25 pm, "Joseph

Re: noob question - Feedparser / Template_Utils / time filters

2007-12-23 Thread James Bennett
On Dec 23, 2007 11:06 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Using modified_parsed gave me this date (2007, 12, 21, 21, 22, 49, 4, > 355, 0) but threw an error when applying a filter: AttributeError > at / 'time.struct_time' object has no attribute 'year' > > I think I am just not

Re: Templates, filesystem, caching?

2007-12-23 Thread forgems
Template loader returns a source code for template, not parsed Template object. So no big gain here :( > In the early days of Django, Adrian, Simon et al looked at that. It > wasn't worth it, since, in the grand scheme of things, template caching > and checking the cache wasn't that much faster

Re: Using CheckboxSelectMultiple

2007-12-23 Thread Alex Ezell
OK, I figured out the array type in Postgresql to get this to work. Now, the challenge is to read through the array when I am displaying the values and match them up with the choices in the model. /alex On Dec 23, 2007 12:20 PM, Alex Ezell <[EMAIL PROTECTED]> wrote: > Tim,Sorry for the late

Re: (Newbie) TemplateSyntaxError in admin panel

2007-12-23 Thread Rex Eastbourne
Hi, Is there any solution to the below described problem? I still haven't been able to get it to work. Best, Rex On Dec 20, 3:11 am, Rex Eastbourne <[EMAIL PROTECTED]> wrote: > Hello, > > I'm going through the Django tutorial for Django 0.9.6 on Windows > Vista. Everything is going smoothly,

Re: Templates, filesystem, caching?

2007-12-23 Thread forgems
Hi. In production environment IMHO it really doesn't matter because you have to restart server anytime you change the python code. If you treat templates as code that really doesn't matter. We have about 50 production servers and we restart a farm every time we change the code. We do it

newforms and many objects instances

2007-12-23 Thread Chaves
Dear Sirs: I have this model class Student(models.Model): name = models.CharField(max_length=50) class StudentGroup(models.Model): name = models.CharField(max_length=20) student = models.ForeignKey(Student) class Subjects(models.Model): name =

Re: Using CheckboxSelectMultiple

2007-12-23 Thread Alex Ezell
Tim,Sorry for the late reply, but I'm just now getting around to this. This definitely gives me the widget I want and the Forms class is happy, but I can't seem to find anything about what type of DB field or Model field this should be. The errors I get say that the value posted is of type

Re: Templates, filesystem, caching?

2007-12-23 Thread Rob Hudson
On 12/23/07, Eratothene <[EMAIL PROTECTED]> wrote: > Your snippet requires to restart django each time the templates have > changed. Did you try to add checking of template file modification > date in order automatically invalidate cache? What it is performance > of such implementation? Adding

newforms-admin: specify model level extra js files (the js admin option)

2007-12-23 Thread Michel Thadeu Sabchuk
Hi guys, I'm migrating some of my applications to newforms-admin branch and I have a question about the way I should define extra js files at model level administration. Coming from standard django admin configuration I should expect that the following code would work: from django.contrib

Re: noob question - Feedparser / Template_Utils / time filters

2007-12-23 Thread [EMAIL PROTECTED]
James - Thanks, I had worked through the date_parsed items - but was getting the same error. Maybe I was missing some other piece at that point. i will give it another shot. Using modified_parsed gave me this date (2007, 12, 21, 21, 22, 49, 4, 355, 0) but threw an error when applying a filter:

Re: noob question - Feedparser / Template_Utils / time filters

2007-12-23 Thread James Bennett
On Dec 23, 2007 10:19 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > That all works - (renders as Fri, 21 Dec 2007 21:22:49 + ) but I > can not apply any Django time filters (date, timesince, naturalday) to > the {{entry.date }} variable. I would guess it is not recognizing the > date as

noob question - Feedparser / Template_Utils / time filters

2007-12-23 Thread [EMAIL PROTECTED]
I am using template_utils.feeds to parse and import feeds. On the template it looks like this: {% endcache %} {% cache 5 sample_feed %} Feed {% parse_feed "http://example.com/feed.rss; as sample_feed %} {% for entry in sample_feed.entries %} {{ entry.title}} {{ entry.date }} {% endfor %}

Re: ModelForm and required fields

2007-12-23 Thread Joseph Kocherhans
On 12/23/07, Julien <[EMAIL PROTECTED]> wrote: > > Hi there, > > I don't understand why the form doesn't validate when I don't fill out > a ManyToManyField. > > Here's the code: > > class Participant(models.Model): > project = models.ForeignKey(Project, related_name='participants') >

Re: Templates, filesystem, caching?

2007-12-23 Thread Eratothene
Hi forgems! Your snippet requires to restart django each time the templates have changed. Did you try to add checking of template file modification date in order automatically invalidate cache? What it is performance of such implementation? Adding this kind of mechanism will increase performace

Re: Django for a seminar registration app?

2007-12-23 Thread Nicolai Richter (Gm)
On Dec 23, 6:57 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > dead easy - you could even take a look at this (feel free to   > cannibalise it as long as you give us some credit), or you could add   > your seminar stuff as a module and we would help out there: > >

Re: Templates, filesystem, caching?

2007-12-23 Thread forgems
Hi, i'm author of the snippet http://www.djangosnippets.org/snippets/507/. I have used simple dictionary because pickling and unpickling values from the cache are IMHO to expensive and don't give a big speed boost over parsing. Also if you use memcache or filesystem backend for caching (pretty

is there any way to avoid restart apache when changed django code to see the modification

2007-12-23 Thread xlm
I installed apache+mod_python+python+django. but the annoy thing is any time I changed code a restarting of apache must needed to see the change. looking for a better way. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: ModelForm and required fields

2007-12-23 Thread Julien
Oh, and here's the view: def edit_participant(request, project_pk, participant_pk): project = get_object_or_404(Project, pk = project_pk) participant = get_object_or_404(Participant, pk = participant_pk) if request.method == 'POST': form =

ModelForm and required fields

2007-12-23 Thread Julien
Hi there, I don't understand why the form doesn't validate when I don't fill out a ManyToManyField. Here's the code: class Participant(models.Model): project = models.ForeignKey(Project, related_name='participants') roles = models.ManyToManyField(Role, blank=True, null=True) user =