Пример #1
0
def create(request):
    this_user 	= request.user
    band_name 	= request.POST.get( 'band_name', '' )
    this_band 	= Band.objects.create( name=band_name ) 
    membership 	= UserHasBand( user=this_user, band=this_band )
    membership.save()
    return HttpResponseRedirect('/dashboard/')
Пример #2
0
def join(request, band_id):
    this_user 	= request.user
    this_band 	= Band.objects.get(pk=band_id)
    membership 	= UserHasBand( user=this_user, band=this_band )
    membership.save()
    return HttpResponseRedirect('/dashboard/')