First time here? Check out the FAQ!

Revision history  [back]

Those are session-based messages that are displayed on screen by the system, not to be confused with the django db messages, also not to be confused with user-to-user private messages.

The reason why the session messages are used is that anonymous users don't have the db record in the auth_user table therefore it will be impossible AFAIK to use the standard django messages for this purpase.

Please have a look at middleware/anon_user.py - that initializes the user messages api. It has the API identical to the Django ORM, but in reality has nothing to do with that.

The idea was to be able to do do this for examlpe:

request.user.SEND_MESSAGE('Sorry, but to do this you need to register first.') #SEND_MESSAGE is a fictional function

As of time of this answer we do this:

request.user.message_set.create(message='Sorry, but to do this you need to register first.')

Note that it works when request.user.is_anonymous() == True

When user is authenticated we are storing message into askbot.models.message.py:Message. This model is hooked up to the User model via the .add_to_class call.

Those are session-based messages that are displayed on screen by the system, not to be confused with the django db messages, also not to be confused with user-to-user private messages.

The reason why the session messages are used is that anonymous users don't have the db record in the auth_user table therefore it will be impossible AFAIK to use the standard django messages for this purpase.

Please have a look at middleware/anon_user.py - that initializes the user messages api. It has the API identical to the Django ORM, but in reality has nothing to do with that.

The idea was to be able to do do this for examlpe:

request.user.SEND_MESSAGE('Sorry, but to do this you need to register first.') #SEND_MESSAGE is a fictional function

As of time of this answer we do this:

request.user.message_set.create(message='Sorry, but to do this you need to register first.')

Note that it works when request.user.is_anonymous() == True

When user is authenticated we are storing message into askbot.models.message.py:Message. This model is hooked up to the User model via the .add_to_class call.

model.

Those are session-based messages that are displayed on screen by the system, not to be confused with the django db messages, also not to be confused with user-to-user private messages.

The reason why the session messages are used is that anonymous users don't have the db record in the auth_user table therefore it will be impossible AFAIK to use the standard django messages for this purpase.

Please have a look at middleware/anon_user.py - that initializes the user messages api. It has the API identical to the Django ORM, but in reality has nothing to do with that.

The idea was to be able to do do this for examlpe:

request.user.SEND_MESSAGE('Sorry, but to do this you need to register first.') #SEND_MESSAGE is a fictional function

As of time of this answer we do this:

request.user.message_set.create(message='Sorry, but to do this you need to register first.')

Note that it works when request.user.is_anonymous() == True

When user Currently there is authenticated we are storing no way of sending a system message into askbot.models.message.py:Message. This model is hooked up to the User model.

to multiple users and store them in the database in order to be displayed later.

Those are session-based messages that are displayed on screen by the system, not to be confused with the django db messages, also not to be confused with user-to-user private messages.

The reason why the session messages are used is that anonymous users don't have the db record in the auth_user table therefore it will be impossible AFAIK to use the standard django messages for this purpase.

Please have a look at middleware/anon_user.py - that initializes the user messages api. It has the API identical to the Django ORM, but in reality has nothing to do with that.

The idea was to be able to do do this for examlpe:

request.user.SEND_MESSAGE('Sorry, but to do this you need to register first.') #SEND_MESSAGE is a fictional function

As of time of this answer we do this:

request.user.message_set.create(message='Sorry, but to do this you need to register first.')

Note that it works when request.user.is_anonymous() == True

Currently there is no way of sending a message from a system message to multiple users and store them in the database in order to be displayed later.

database.

Those are session-based messages that are displayed on screen by the system, not to be confused with the django db messages, also not to be confused with user-to-user private messages.

The reason why the session messages are used is that anonymous users don't have the db record in the auth_user table therefore it will be impossible AFAIK to use the standard django messages for this purpase.

Please have a look at middleware/anon_user.py - that initializes the user messages api. It has the API identical to the Django ORM, but in reality has nothing to do with that.

The idea was to be able to do do this for examlpe:

request.user.SEND_MESSAGE('Sorry, but to do this you need to register first.') #SEND_MESSAGE is a fictional function

As of time of this answer we do this:

request.user.message_set.create(message='Sorry, but to do this you need to register first.')

Note that it works when request.user.is_anonymous() == True

Currently there is no way of sending a message from a system to multiple users and store them in the database.

Those are session-based messages that are displayed on screen by the system, not to be confused with the django db messages, also not to be confused with user-to-user private messages.

The reason why the session messages are used is that anonymous users don't have the db record in the auth_user table therefore it will be impossible AFAIK to use the standard django messages for this purpase.

Please have a look at middleware/anon_user.py - that initializes the user messages api. It has the API identical to the Django ORM, but in reality has nothing to do with that.api.

The idea was to be able to do do this for examlpe:

request.user.SEND_MESSAGE('Sorry, but to do this you need to register first.') #SEND_MESSAGE is a fictional function

As of time of this answer we do this:

request.user.message_set.create(message='Sorry, but to do this you need to register first.')

Note that it works when request.user.is_anonymous() == True