Re: How to extract a number from a url

2018-12-06 Thread Sourajit Mohanty
$', 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'] >&

Re: How to extract a number from a url

2018-12-05 Thread Sourajit Mohanty
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

Re: How to extract a number from a url

2018-12-05 Thread Sourajit Mohanty
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

How to extract a number from a url

2018-12-05 Thread Sourajit Mohanty
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

How to access the Album's ID in the Songs Class??

2018-12-04 Thread Sourajit Mohanty
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

How 2 access the Primary model's ID in the Foreign model??

2018-12-04 Thread Sourajit Mohanty
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