Glyn Jackson
unread,Dec 19, 2012, 4:53:40 AM12/19/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
In other languages and frameworks I have used when you have an entity such as user. Each entity has an event lifecycle i.e. post update, pre update, post save etc
The following code below is my first save using Django. But its looks very messy, it should be than user has a pre create for member and member has a pre create for user depending on which way you are coming at it
In Django is this possible?
in my views.py
user = User.objects.create_user(
username=form.cleaned_data.get()['username'],
email=form.cleaned_data['email'],
password=form.cleaned_data['password']
)
user.save()
member = Member(
user=user,
name=form.cleaned_data['name']
)
member.save()