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

2018-12-04 Thread Saurabh Agrawal
I think you can use "self.album.id" or "self.album_id". On Wed, Dec 5, 2018 at 9:20 AM Sourajit Mohanty wrote: > 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_del

Re: Remove user permission

2018-12-03 Thread Saurabh Agrawal
"user.user_permissions.remove" expects a permission object. Or the pk of that object. Hence, the TypeError. On Mon, Dec 3, 2018 at 9:02 PM Gaurav Tomer wrote: > I was trying to remove permission of a user using remove utility as below - > > user = User.objects.get(id=user_id) > user.user_permiss

Re: Unexpected behavior on delete of model

2018-11-27 Thread Saurabh Agrawal
> > > > > class Doctor(models.Model): > > name = models.CharField(max_length=35) > > username = models.CharField(max_length=15) > > > > class DoctorProfilePic (models.Model): > > name = models.CharField(max_length=255, blank=True) > > pic = StdImageField(uplo

Re: Shared code best practices

2018-11-26 Thread Saurabh Agrawal
Hi The can be kept in independent modules which can then be imported in various apps. At least that's what I do. :-) On Mon, Nov 26, 2018, 20:01 pratibha sharma wrote: > Hi, > > I have some functions which are used by multiple apps in my codebase. > > Functions are like send email, custom excep

Re: How to correct my signals call?

2018-11-21 Thread Saurabh Agrawal
I am sorry, maybe I am understanding wrong, but isn't log as expected? Since the signal is run synchronously within the Django request, "POST /adminapp/merchantstores/add/" gets logged, only after the signal has finished running. On Wed, Nov 21, 2018 at 6:55 PM Yavin Aalto Arba wrote: > if crea

Re: Usage opinion wanted

2008-11-26 Thread Saurabh Agrawal
Hi Jeff, Thanks again for all the info. Can I trouble you a little more, for something which in fact, might not be Django related at all? You can choose to completely ignore this message, of course. I just want to know what is this server you are talking about? Is that some kind of insulation la

Re: Usage opinion wanted

2008-11-25 Thread Saurabh Agrawal
ice, but really, it boils down to this: > writing a GUI app will take *much* longer than writing the equivalent > with Django. However, you may have to sacrifice some usability. > > -Jeff > > On Nov 24, 8:24 pm, "Saurabh Agrawal" <[EMAIL PROTECTED]> wrote: >

Usage opinion wanted

2008-11-24 Thread Saurabh Agrawal
as the admin interface, I would go for it and it might be a good experience for me. Thanks for reading this slightly incoherent and maybe off-topic mail. All suggestions are welcome and I would be grateful for them. Regards, Saurabh Agrawal

[Novice]Importing standalone apps in a project

2008-11-20 Thread Saurabh Agrawal
Hi, I am following Practial Django Projects book. In Chapter 4, Django Powered Weblog, James talks about standalone apps. The basic premise seems to be to include the app in the python path. I have done that. Using the Python IDLE, I am able to issue command "import coltrane" without problem. (c