Thanks for the advice, phillc. I ended up doing this in the view.
As you mention, one of the reasons is that when the invite is used
(user clicks the link), I mark the invite as being completed. I don't
need to recalculate the hash at that point.
I'm basically just using it as an ID for that
ive implemented a hash in the save method, and ive implemented in the
model default=(hash function), and ive done it in my view.
they all worked fine, just remember if you override save, if you have
any data that goes along with the invite and edit it, the hash will be
created again unless you
On Sun, Apr 6, 2008 at 1:38 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> The way I would handle it is in the save method of the invitation
> model I would do:
> def save(self, *args, **kwargs):
> if not self.pk:
> #This is a new invite, we need to generate the code
>
The way I would handle it is in the save method of the invitation
model I would do:
def save(self, *args, **kwargs):
if not self.pk:
#This is a new invite, we need to generate the code
self.hash = do_something_to_generate_the_hash
super(Invite, self).save(*args, **kwargs)
My use case is that I need to send invites via email to people. These
are not site users, but are people being invited to join the site (and
a particular group on this site) by current users. So, I can't ask
them to login, because I have no data about them.
They would then click the link in the
5 matches
Mail list logo