Le Vendredi 09 Juin 2006 20:06, Ilias Lazaridis a écrit :
the code below works, but has the limitation that I cannot import the
syncdb_hook within django.core.management.
In [4]: from b import CONS
In [5]: import b
In [6]: b.CONS = 3
In [7]: CONS
Out[7]: 5
In [8]: from b import CONS
In
Maric Michaud wrote:
Le Vendredi 09 Juin 2006 20:06, Ilias Lazaridis a écrit :
the code below works, but has the limitation that I cannot import the
syncdb_hook within django.core.management.
In [4]: from b import CONS
In [5]: import b
In [6]: b.CONS = 3
In [7]: CONS
Out[7]: 5
Maric Michaud wrote:
Le Jeudi 08 Juin 2006 14:28, Ilias Lazaridis a écrit :
Another possibility is to enlink (hook?) the functionality into an
existent function
Is there any way (beside a patch) to alter the behaviour to an existing
function. Is ther a python construct similar to the
Ilias Lazaridis wrote:
#patch_service.py
from toto import service
def my_impl(self, *args) :
old_result = self._old_method(*args)
# ...
return new_result
if not hasattr(service, '_old_method') :
service._old_method = service.method
service.method = my_impl
Duncan Booth wrote:
Ilias Lazaridis wrote:
#patch_service.py
from toto import service
def my_impl(self, *args) :
old_result = self._old_method(*args)
# ...
return new_result
if not hasattr(service, '_old_method') :
service._old_method = service.method
Slawomir Nowaczyk wrote:
On Thu, 08 Jun 2006 15:28:39 +0300
Ilias Lazaridis [EMAIL PROTECTED] wrote:
# *IMPORT*
#
# I would like to know, if this construct is valid, or if it can
# result in problems (that I do not see as a newcomer):
The intricacies of import are far beyond me, but
I have a few small questions subjecting python functionality, most
importantly the alias_method.
-
*IMPORT*
I would like to know, if this construct is valid, or if it can result in
problems (that I do not see as a newcomer):
1082try:
1083from django.rework.evolve
Ilias Lazaridis wrote:
I would like to know, if this construct is valid, or if it can result in
problems (that I do not see as a newcomer):
1082try:
1083from django.rework.evolve import evolvedb
1084except ImportError:
1085def evolvedb():
Ilias Lazaridis wrote:
Is there any way (beside a patch) to alter the behaviour to an
existing function. Is ther a python construct similar to the
alias_method of Ruby:
This is a Python list. Would you care to explain what alias_method does?
(example from an simple evolution support for
Le Jeudi 08 Juin 2006 14:28, Ilias Lazaridis a écrit :
Another possibility is to enlink (hook?) the functionality into an
existent function
Is there any way (beside a patch) to alter the behaviour to an existing
function. Is ther a python construct similar to the alias_method of Ruby:
No,
Since your question is so much about Django, you might want to ask on
Django groups.
Oops, you're not welcome there anymore, almost forgot.
But if merely reading the subject of a posting I already know who's the
poster, it's perhaps a bad sign.
Further readers of this thread might be interested
Le Jeudi 08 Juin 2006 15:15, Duncan Booth a écrit :
but the more usual way is just to call the original method directly in the
base class.
class SqliteAdapter(BaseClass):
def create_table(self, *args)
self.table_evolve(*args)
result = BaseClass.create_table(self, *args)
Tim N. van der Leeuw wrote:
[...]
http://case.lazaridis.com/wiki/Please
.
--
http://lazaridis.com
--
http://mail.python.org/mailman/listinfo/python-list
Maric Michaud wrote:
Le Jeudi 08 Juin 2006 15:15, Duncan Booth a écrit :
but the more usual way is just to call the original method directly in the
base class.
class SqliteAdapter(BaseClass):
def create_table(self, *args)
self.table_evolve(*args)
result =
Duncan Booth wrote:
Ilias Lazaridis wrote:
I would like to know, if this construct is valid, or if it can result in
problems (that I do not see as a newcomer):
1082try:
1083from django.rework.evolve import evolvedb
1084except ImportError:
1085
On Thu, 08 Jun 2006 06:05:35 -0700
Tim N. van der Leeuw [EMAIL PROTECTED] wrote:
# Since your question is so much about Django, you might want to ask
# on Django groups.
Now *that*, and the rest of your post, was uncalled for.
This thread is perfectly on topic for this list and the question
On Thu, 08 Jun 2006 15:28:39 +0300
Ilias Lazaridis [EMAIL PROTECTED] wrote:
# *IMPORT*
#
# I would like to know, if this construct is valid, or if it can
# result in problems (that I do not see as a newcomer):
The intricacies of import are far beyond me, but FWIW I do not see
anything wrong in
17 matches
Mail list logo