Saving associated data with multiple formset_factory

2008-11-16 Thread Tane Piper
Hey there, The last Django application I worked on was in 0.96 and I'm trying to get used to the new stuff in there. I've been following the docs here: http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#id2 trying to use the formset_factory on some forms. I have a Contact model, and

Re: Overriding returned contents of user objects

2008-04-13 Thread Tane Piper
ons' I have tried passing it as a field but it comes back that it doesn't exist. Any suggestions? On Sun, Apr 13, 2008 at 12:56 PM, Tane Piper <[EMAIL PROTECTED]> wrote: > Hi Malcolm, > > values() seems to be the way to go for now. I've extracted some of > the

Re: Overriding returned contents of user objects

2008-04-13 Thread Tane Piper
t 11:59 AM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > On Sun, 2008-04-13 at 11:46 +0100, Tane Piper wrote: > [...] > > > What I want to > > know is there any way I could simplify the method and have it remove > > the password field any time a user o

Overriding returned contents of user objects

2008-04-13 Thread Tane Piper
ld simplify the method and have it remove the password field any time a user object is being selected as part of a related query?? I'm sure there is a need for it when doing authorisation, but once a session has been confirmed, is it needed again? -- Tane Piper Blog - http://digitalspag

Re: [OT] Django based full fledged forum app

2008-04-10 Thread Tane Piper
e vBulletine > (because discussion about it rated vBulletine as best). > I am preferring Django based app. > Otherwise, I would go with SimpleMachineForum (SMF). So if the django- > app for forum is not available, please tell me how to integrate the > SMF with django (session and authe

Re: How to do background processing with Django

2008-03-26 Thread Tane Piper
hreading.Thread(...) > t.setDaemon(True) > t.start() > return HttpResponse(..) > > Or does django/apache have limitation on how threading can be used? > Would my thread be killed, once the response is sent back? > > > > -- Tane Piper Blog - http://digitalspaghetti.me.uk

Re: Error Messages

2008-01-31 Thread Tane Piper
t; created in a template view and put it into an error box that would pop > up over the webpage should the user cause an issue. Any help would be > appreciated. Thanks for your time. > Jacob > > > -- Tane Piper Blog - http://digitalspaghetti.me.uk Wii: 4734 3486 7149 1830 This

Re: django-queue-service documentation

2008-01-30 Thread Tane Piper
rting results on > timestamps. As I investigated more and learned about other "service > bus" concepts, it turns out they're all variations and glorified > versions of this concept, with various add-ons to deal with other > interesting and specific problems. The core, though

Re: Simultaneous edits

2008-01-30 Thread Tane Piper
lumns and was wondering if a > different mechanism was in effect. Or if some other technique was widely used > among Django users. > > Any help or ideas appreciated. > > Thanks, > Michael > > > > > > -- Tane Piper Blog - http://digitalspaghetti.me.uk Wii: 4734

Re: django-queue-service documentation

2008-01-27 Thread Tane Piper
, shabda <[EMAIL PROTECTED]> wrote: > > I want to use django-queue-service to run long running processess in > > background, but I can not find any documentation about this. Their > > website http://code.google.com/p/django-queue-service/ does not > > contain any docs. Do

Re: How I see the SQL generated in the system in development?

2008-01-23 Thread Tane Piper
ually going on with a page. Hope that helps. On Jan 23, 2008 3:17 PM, Claudio Escudero <[EMAIL PROTECTED]> wrote: > Hi, > > How I see the SQL generated in the system in development? > Its appears on the console? > > Thank, > Claudio Escudero > > > > -- Tan

Outputting a M2M within a signal

2008-01-05 Thread Tane Piper
As you can see I've commented where the code is not working. When i do repo.active_extentions.all() in the shell it works fine and returns them. Even if e doesn't have the right data at the moment it should still write each line for each active extention. Can anyone help? -- Tane Pip

Showing a WSGI Application in a view

2007-12-31 Thread Tane Piper
y passing anything other than the var headers (which is ). The problem I am having is HOW to I get the now-run WSGI app to display as the page in Django? Any help will be VERY appreciated. -- Tane Piper Blog - http://digitalspaghetti.me.uk Wii: 4734 3486 7149 1830

Re: Problems with initial data

2007-12-14 Thread Tane Piper
Sorry folks, something weird is going on with my email - I'm able to send emails but I don't receive them from the list, so I never got your replied (and it would have saved me a long time searching) Thanks for your replies On Dec 14, 8:56 am, "Tane Piper" <[

Re: Problems with initial data

2007-12-14 Thread Tane Piper
Managed to fix it. Had a hunt in the django code for what the admin modules does and discovered the Model.objects.get_or_create function. Now works perfectly! On 13/12/2007, Tane Piper <[EMAIL PROTECTED]> wrote: > Ok, I've modified this slightly, however still cannot get this

Re: Problems with initial data

2007-12-13 Thread Tane Piper
tcher with a sender (being IssueType, IssueSeverity and IssueStatus) - however when the models are created they don't get called. Take the sender away and each function gets called 8 times - very strange. Can anyone help? On 13/12/2007, Tane Piper <[EMAIL PROTECTED]> wrote: >

Problems with initial data

2007-12-13 Thread Tane Piper
he database, but for issue_types instead of just 4 entries, 36 entries go in. For sev_types and status_types 40 entries go in each instead of 5. From what I can work out, it seems to be looping and adding a full entry for each item within the tuples. Cannot work this one out at all so either

Re: Order By Calculated Value??

2007-12-06 Thread Tane Piper
gory before you call super().save() > > {{{ > class Category(models.Model): > ... > def save(self): > if not self.slug: > self.slug = slugify(self.name) > self.num_entries = self.entry_set.count() > super(Category, self).save() >

Re: Order By Calculated Value??

2007-12-05 Thread Tane Piper
{'fields': ('pub_date',)}), ('Publishing Details', {'fields': ('slug', 'published', 'front_page', 'allow_comments', 'sticky', 'truncate')}),

Re: Order By Calculated Value??

2007-12-05 Thread Tane Piper
hem. > > Yet another solution is to convert your cats queryset to a list, loop > over it to get an entry count, and then sort the list in Python to > pass on to your template. > > So there seem to be many ways to skin this cat. > > -Rajesh Dhawan > > &g

Order By Calculated Value??

2007-12-05 Thread Tane Piper
ble to get this value in my inclusion tag? I had tried before to store this value in a field, but couldn't get it to save, otherwise I would just pass in a field 'num_entries' so if anyone can suggest anything, that would be great. Thanks

Re: Using a signal to update a counter cache??

2007-12-01 Thread Tane Piper
Ok, I've fixed it now. Instead of trying to save the value, I show the value on my list page: def num_leafs(self): return self.leaf_set.count() num_leafs.short_description = "Number of Leafs" Thanks for your help anyway. On Dec 1, 2007 3:40 PM, Tane Piper <[EMAIL

Re: Using a signal to update a counter cache??

2007-12-01 Thread Tane Piper
7;s passing in the text version of content type, and not the id. Any ideas? On Dec 1, 2007 3:15 AM, Simon Willison <[EMAIL PROTECTED]> wrote: > > On Nov 30, 4:48 pm, "Tane Piper" <[EMAIL PROTECTED]> > wrote: > > As you can see in the Branch model, there is

Using a signal to update a counter cache??

2007-11-30 Thread Tane Piper
ield so it contains total number of content leafs for that branch (as a counter cache). I also need to go reduced it by one each time a leaf is removed. If I could get some help with this first one (which I was able to implement easily in PHP but just cannot translate to Django) I think I&#

Re: Passing text object to function and returning text via Pygments

2007-11-29 Thread Tane Piper
automatic-html-escaping > > Karen > > > > On 11/29/07, Tane Piper <[EMAIL PROTECTED]> wrote: > > > > I was actually just about to reply to say I had found this problem :) > > Silly me. However, I now have an issue (which is probably out of > > scope here

Re: Passing text object to function and returning text via Pygments

2007-11-29 Thread Tane Piper
it just doesn't seem to render correctly :/ On Nov 29, 2007 3:47 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > > On 11/29/07, Tane Piper <[EMAIL PROTECTED]> wrote: > > > > > > Hi Folks, > > > > I have only been using Python since the weekend, and

Passing text object to function and returning text via Pygments

2007-11-29 Thread Tane Piper
et': Paste.objects.all(),\r\n}\r\n\r\nurlpatterns = patterns('',\r\n (r'^$', 'django.views.generic.list_detail.object_list', info_dict),\r\n (r'^(?P\\d+)/$', 'pastemonkey2.pastes.views.show_paste'),\r\n)", , ) Instead of nice marked up code