Check out the Django docs on Many-to-one Relationships. In the "Querying in the opposite direction" example, you can see that within the filter you can access the related object.
In your example, you can get all User records without a related A object with the query:
User.objects.filter(a__isnull=True)
In the case of one-to-many ForeignKeys, I typically specify the related_name
argument as the plural version of the model name. It helps to make the one-to-many relationship clearer.
In your example it would look like this:
class User(models.Model)
pass
class A(models.Model):
current_user_id = ForeignKey(User, related_name='as')
# now the above query would look like this:
User.objects.filter(as__isnull=True)
It helps clarify which model is the one and which model is the many in the one-to-many relationship.