$', views.CreateSong.as_view())
>
> On Wednesday, December 5, 2018 at 11:55:08 PM UTC-5, Sourajit Mohanty
> wrote:
>>
>> I am using Model forms..
>>
>> class CreateSong(CreateView)
>>model=Song
>>fields=['song_title']
>&
is:
>
> url(r'^music/(?P[0-9]+)/newsongs$', views.your_view_function())
>
>
> cheers!
>
> On 12/6/18, Sourajit Mohanty wrote:
> > I am working with Class based Views..so I dont think this is gonna work
> >
> > On Thu 6 Dec, 2018, 2:33 AM sh
I am working with Class based Views..so I dont think this is gonna work
On Thu 6 Dec, 2018, 2:33 AM shiva kumar Use
>
> in place of number
>
> An add extra parameter in views which u will relate this to
>
> On Thu 6 Dec, 2018 2:18 am Sourajit Mohanty
>> I want to extr
I want to extract the number from this url 'music/6/newsongs/' so that I can
use that number to redirect it to another page..
How can I do that??
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving
class Album(models.Model):
artist=models.CharField(max_length=250)
title=models.CharField(max_length=500)
class Song(models.Model):
album=models.ForeignKey(Album,on_delete=models.CASCADE)
song_title=models.CharField(max_length=250)
def get_absolute_url(self):
//I need to access the Album
I have 2 model classes Album and Songs(where Song is the Foreign key)
I want to access the Albums ID in the Songs class..
How can I do that??
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving email
6 matches
Mail list logo