Pluggable application template customization

2009-01-09 Thread Olivier Guilyardi
loading default templates. How can I add support for this optional templates/telemeta directory, automatically, whenever one has installed telemeta ? Regards, -- Olivier Guilyardi / Samalyse --~--~-~--~~~---~--~~ You received this message because you are su

Re: Pluggable application template customization

2009-01-09 Thread Olivier Guilyardi
Malcolm Tredinnick wrote: > On Fri, 2009-01-09 at 14:00 +0100, Olivier Guilyardi wrote: >> Hi, >> >> We have developed Telemeta, a "pluggable" Django application (to be added to >> INSTALLED_APPS). It works great. We now need to support per-project templates &

Re: Pluggable application template customization

2009-01-09 Thread Olivier Guilyardi
Olivier Guilyardi wrote: > Malcolm Tredinnick wrote: >> On Fri, 2009-01-09 at 14:00 +0100, Olivier Guilyardi wrote: >>> >>> How can I add support for this optional templates/telemeta directory, >>> automatically, whenever one has installed telemeta ? >>

Re: Design question: Persistent / non-transactional process & django

2008-09-11 Thread Olivier Guilyardi
..) run a cron job (a simple Python script) that checks the database table, establish the needed TCP connection, send it all and cleanup the sent entries from the table. Hope that helps, -- Olivier / Samalyse -- Olivier Guilyardi / Samalyse --~--~-~--~~~---~

Application template inheritance and customization

2010-01-15 Thread Olivier Guilyardi
ault template to customize it. But, do you see a way to avoid those single-line "templates" located in telemeta/templates/telemeta? -- Olivier Guilyardi / Samalyse -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
Hi, I'm trying to split tests.py into individual files into a tests/ subfolder, but that doesn't work. I correctly import everything from within tests/__init__.py, as previously said on this mailing list: http://groups.google.com/group/django-users/browse_frm/thread/10cfd65e398360d2/dae3a7226dccd

Re: Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
On 01/18/2010 09:19 PM, Reinout van Rees wrote: > On 01/18/2010 08:40 PM, Olivier Guilyardi wrote: >> Hi, >> >> I'm trying to split tests.py into individual files into a tests/ >> subfolder, but >> that doesn't work. >> >> I correc

Re: Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
On 01/18/2010 08:59 PM, Shawn Milochik wrote: > Here's a fantastic resource. It's what I used to switch to this methodology. > It talks you through exactly how to do this. > > http://ericholscher.com/blog/2008/nov/4/introduction-pythondjango-testing-basic-unit-tests/ Oh yes, I found this one. T

Re: Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
On 01/18/2010 09:58 PM, Shawn Milochik wrote: > On Jan 18, 2010, at 3:50 PM, Olivier Guilyardi wrote: > >> On 01/18/2010 08:59 PM, Shawn Milochik wrote: >>> Here's a fantastic resource. It's what I used to switch to this >>> methodology. It talks you thro

Re: Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
On 01/18/2010 10:04 PM, Ramiro Morales wrote: > On Mon, Jan 18, 2010 at 4:40 PM, Olivier Guilyardi wrote: >> Hi, >> >> I'm trying to split tests.py into individual files into a tests/ subfolder, >> but >> that doesn't work. >> >> I correc

Re: Splitting tests.py

2010-01-18 Thread Olivier Guilyardi
On 01/18/2010 10:21 PM, Olivier Guilyardi wrote: > On 01/18/2010 10:04 PM, Ramiro Morales wrote: >> On Mon, Jan 18, 2010 at 4:40 PM, Olivier Guilyardi wrote: >>> Hi, >>> >>> I'm trying to split tests.py into individual files into a tests/ subfolder,

Re: Splitting tests.py

2010-01-20 Thread Olivier Guilyardi
On 01/20/2010 10:58 AM, Matt Schinckel wrote: > On Jan 19, 7:21 am, Olivier Guilyardi wrote: >> On 01/18/2010 10:04 PM, Ramiro Morales wrote: >> >> >>> On Mon, Jan 18, 2010 at 4:40 PM, Olivier Guilyardi wrote: >>>> Hi, >>>> I'm

Re: Splitting tests.py

2010-01-20 Thread Olivier Guilyardi
On 01/20/2010 01:21 PM, Matt Schinckel wrote: > On Jan 20, 9:25 pm, Olivier Guilyardi wrote: [...] >> Please see my last mail, this issue is resolved. Indeed it was import-related >> and silently failing. > > Yes, it came through as I was replying :) Then I think that

Iterating over a QuerySet

2010-01-20 Thread Olivier Guilyardi
For best performances, should I: records = MyModel.objects.all() for item in records: ... or is the following ok: for item in MyModel.objects.all(): ... ? -- Olivier -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Iterating over a QuerySet

2010-01-20 Thread Olivier Guilyardi
On 01/20/2010 08:41 PM, Daniel Roseman wrote: > On Jan 20, 7:09 pm, Olivier Guilyardi wrote: >> For best performances, should I: >> >> records = MyModel.objects.all() >> for item in records: >> ... >> >> or is the follow

Dealing with polyhierarchical data

2010-01-27 Thread Olivier Guilyardi
Hi, I'm working with a polyhierarchical thesaurus, and trying to handle that in Django. By polyhierarchical, I mean : nodes can have both multiple parents and children. Actually, this is a geographical thesaurus, and yes a location can have multiple parents (being across countries, etc..). I hav

Re: Dealing with polyhierarchical data

2010-01-29 Thread Olivier Guilyardi
On 01/28/2010 11:12 AM, Matthias Kestenholz wrote: > Hi > > On Wed, Jan 27, 2010 at 11:29 PM, Olivier Guilyardi wrote: >> Hi, >> >> I'm working with a polyhierarchical thesaurus, and trying to handle that in >> Django. By polyhierarchical, I mean : nodes

Dynamic Model Fields

2007-04-11 Thread Olivier Guilyardi
Hi, I'm in the process of turning telemeta [1] into a django application, and need dynamic model fields: we want to allow site administrators to easily add/remove "fields" to our main data structure, the MediaItem, which represents an audio/video resource. Example: for a given research laborator

Re: Dynamic Model Fields

2007-04-11 Thread Olivier Guilyardi
Tim Chase wrote: >> I'm in the process of turning telemeta [1] into a django >> application, and need dynamic model fields: we want to allow >> site administrators to easily add/remove "fields" to our main >> data structure, the MediaItem, which represents an audio/video >> resource. > > Our curr

Re: Dynamic Model Fields

2007-04-11 Thread Olivier Guilyardi
Tim Chase wrote: >> Actually the labs where just an example: one laboratory will >> have one installation of the application, and the dynamic >> fields will only apply within the scope of this installation. >> There's no such thing as consistency accross labs. > > It still sounds like the above s

Re: Dynamic Model Fields

2007-04-12 Thread Olivier Guilyardi
Olivier Guilyardi wrote: > I'm still a python newbie, but it seems to me that there could be a way to > modify the model definition before Django knows about it: Okay, I found the Field.contribute_to_class() method which seems to work just fine. I'm calling it right afte

Named URL problem

2007-05-10 Thread Olivier Guilyardi
Hi, Named URLs don't work for me so far. I'm using rev 5180. In my site's urls.py I have: (r'^', include('telemeta.urls')), In telemeta/urls.py: url(r'^collections/(?P[0-9A-Z._-]+)/?$', 'django.views.generic.list_detail.object_detail', dict(all_collections, template_name="collec

Re: Named URL problem

2007-05-10 Thread Olivier Guilyardi
[EMAIL PROTECTED] wrote: > I'd suggest trying {% url telemeta-collection-detail object.id %} Thanks that fixed it ! It's not object.id, it's p.id, but it wasn't defined at this point in the template. It put the statement back in the loop where p.id is defined and it works great :) -- Olivier

Custom filter/tag and template inheritance

2007-05-14 Thread Olivier Guilyardi
Hi, I have a custom filter which I expect to use in many templates. So instead of adding {% load my_lib.py %} into every template I'd like to put it into base.html which all templates extend. But it doesn't work: when I move the load statement to the parent template and access the child template

Limiting SQL queries in a custom manager method

2007-05-18 Thread Olivier Guilyardi
Hi, How can I know about the limiting parameters inside a custom manager method? Example: class MyManager(models.Manager): def my_query(self): # How can I find out about offset and length ? cursor.execute("SELECT foo FROM bar LIMIT %d, %d", [offset, length]) class MyModel(m

Re: Limiting SQL queries in a custom manager method

2007-05-18 Thread Olivier Guilyardi
Malcolm Tredinnick wrote: > On Fri, 2007-05-18 at 23:50 +0200, Olivier Guilyardi wrote: >> >> How can I know about the limiting parameters inside a custom manager method? >> >> Example: >> >> class MyManager(models.Manager): >> def my_query(self):

Re: Limiting SQL queries in a custom manager method

2007-05-20 Thread Olivier Guilyardi
Jeremy Dunck wrote: > On 5/18/07, Olivier Guilyardi <[EMAIL PROTECTED]> wrote: > ... >> Okay, so I suppose a workaround is to pass offset and length as arguments to >> my_query() >> > ... >> I suppose I may also try to extend the QuerySet class to add m

Reverse URL resolver fails with a literal dot

2007-05-24 Thread Olivier Guilyardi
Hi, In my urls.py I have the following entry: url(r'^items/download/(?P[0-9A-Za-z._:%?-]+)\.(?P[0-9a-z]+)$', web_view.item_export, name="telemeta-item-export"), In my template: {% url telemeta-item-export item.id|urlencode,format.extension %} For item.id = "BM.001:006" and form

Re: Reverse URL resolver fails with a literal dot

2007-05-25 Thread Olivier Guilyardi
akonsu wrote: > i would say that yes it is a bug. i have seen many bugs in the reverse > resolver code. for example, it crashes (throws a python exception) if > a regex pattern contains question marks (optional elements) and i am > sure it has a lot more. my personal opinoin is that this code is >

Re: Reverse URL resolver fails with a literal dot

2007-05-25 Thread Olivier Guilyardi
Malcolm Tredinnick wrote: >> This seems to mean that the resolver and the reverse resolver are not >> symmetrical. Is this a bug? > > It is. There's a sort of correct patch to fix a few things like this in > Trac, so we'll get to checking it in at some point. Should I post a ticket? Regards,

Re: Reverse URL resolver fails with a literal dot

2007-05-25 Thread Olivier Guilyardi
Malcolm Tredinnick wrote: > On Fri, 2007-05-25 at 11:07 +0200, Olivier Guilyardi wrote: >> Malcolm Tredinnick wrote: >> >>>> This seems to mean that the resolver and the reverse resolver are not >>>> symmetrical. Is this a bug? >>> It is. There&#x

Re: Reverse URL resolver fails with a literal dot

2007-05-25 Thread Olivier Guilyardi
akonsu wrote: > yes, it is an innovative feature. i think it is difficult to implement > right. the general problem in my understanding is to be able to > generate a regex that accepts a (partial) input string. then, to > compare the generated regex with the list in the urls module. this > involve