On 2013-05-11 18:36, Anssi Kääriäinen wrote:
> On 12 touko, 02:55, Russell Keith-Magee <[email protected]>
> > What is on the table is essentially adding a refresh() call on an
> > object instance that is an API analog of
> > ".get(id=self.id)"
I guess my minor quibble is about the name itself and possible
clashes with existing fields/methods:
class MyModelA(Model):
# ...
refresh = BooleanField(...)
# ...
class MyModelB(Model):
# ...
def refresh(...): do_something_refreshing()
# ...
a = MyModelA.objects.get(pk=some_id)
b = MyModelB.objects.get(pk=other_id)
# ...
if a.refresh: # legacy code expects a BooleanField
# whoops, what happens here under this proposal?
if b.refresh(): # legacy code expects local logic, not Django logic
# or what gets called here?
I wouldn't want to see any breakage when upgrading between versions.
I don't have a good proposal, other than perhaps _refresh() or
__refresh__(), or cramming it into Meta (I don't know if that would
even work).
-tkc
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.