Custom Event Registration Form - python

Newbie with Odoo..
I am using the Events module for creating an Event Management Platform.
The registration process is clear however, I want to customize it a little bit.
Instead of sending a link and the user chooses a specific ticket then a modal pops up, I want to send directly a link containing a form for registration without other details.
In another words, How can I make a separate form and make it for event registration ? or is there any other workaround ?

Related

How do I customise the flask-user registration and login functions?

I want to customise the functions that process the results of completing the flask-user registration and login forms. I know how to customise the html forms themselves, but I want to change how flask-user performs the registration process. For example, I want to prevent the flask-user login and registration process from creating flash messages and I want registration to process a referral code.
I understand how to add an _after_registration_hook to perform actions after the registration function has completed, but, this doesn't allow me to remove the flash messages that are created in the login and registration processes.
My custom login and registration processes would build on the existing flask-user login and registration functions with functionality added or removed.
You seem to be asking about the flask-user package - however you tagged this with flask-security (which is a different package but offers similar functionality). I can answer for flask-security-too (my fork of the original flask-security) - if you are/want to use flask-user - it might be useful to change your tags.
In a nutshell - for flask-security - you can turn off ALL flashes with a config variable.
For registration - you can easily override the form and add a referral code - and validate/process that as part of form validation.

How to automatically generate notification to user when events is added?

I have developed a website having functionality such as writing,posting ,user profiles, events & activities, offers..etc.I need to add one more functionality and i.e. Automatic push notification to the users about activities & events, offers and discounts (facebook like notification).
What I want to do is to inform users in their profiles, whenever admin/staff add their events & activities and offers or if user are updating profile, then inform the user of that update. I have looked around many applications but I am still very confused about how to do it.
I really need some proper tutorial or guidance on how to go about doing it. I know how to register a notification and send it on proper signal but there is no documentation on how to show these notices in a template, if this can be done.

How the user of my Django app can create "customized" tasks?

I am new to Celery and I can't figure out at all how I can do what I need. I have seen how to create tasks by myself and change Django's file settings.py in order schedule it. But I want to allow users to create "customized" tasks.
I have a Django application that is supposed to give the user the opportunity to create the products they need (files that gather weather information) and to send them emails at a frequency they choose.
I have a database that contains the parameters of every product like geographical time, other parameters and frequency. I also have a script sendproduct.py that sends the product to the user.
Now, how can I simply create for each product, user created a task that execute my script with the given parameters and the given frequency?
As you know how to create & execute tasks, it's very easy to allow customers to create tasks.
You can create a simple form to get required information from the user. You can also have a profile page or some page where you can show user preferences.
The above form helps to get data(like how frequently he needs to receive eamils) from user. Once the form is submitted, you can trigger a task asynchronously which will does processing & send emails to customer.

Django admin: live update of change list page

I use the Django admin "change list" page to monitor the state of objects created and updated by my site's users. I find myself frequently refreshing the page as my users do their work. Is there a good way to make it automatically refresh, so that I can see new changes within a few seconds? Looking for a technique that is easily reusable across my project's many "change list" pages.
For an easy implantation you could set up a button to only refresh the changelist through an ajax call instead of the whole page (though setting it up with a view would be easier than changing the built in admin site without breaking anything). You can also set that function to refresh on a given interval.
Another option is to look at implementing Comet technology such as a push server. It would load new entries whenever they are added (like how Facebook does). It's rather complicated, but if you're up to it it might serve your purpose

How to be able to avoid a browser refreshing a page, after a HTTP POST request has been sent in Python/CGI

I am writing a CGI script in python 2.5 and I have run into an issue I cant solve.
My cgi script allows a user to into data into a html form and press refresh and the data gets successfully added. But it has turned out that if a user presses the refresh button on their browser the data that they inputted before gets added again. This is not the behaviour that I am looking for, and as such I would love to be able to redirect a user after a HTTP POST/GET request back to the main page.
This is of course naturally possible, by using the :
print "Location: www.website.here"
line in python. But I cannot do this as I need to be able to store messages between each refresh in order to be able to display information to the user.
These messages are essentially validation error messages, and if a user inputs wrong data and presses submit then my page should reload and print the error messages. I have this side of things working, but if I need to redirect using the above line, then I loose this.
So my question is are there any other possible ways to remove the option to refresh a html page using CGI and python, or am I looking at this all wrong and should I be trying to find a way to store my messages after a HTML redirect?
I assume you actually have two scenarios:
The user entered the data correctly; reloading the page would cause the added data to be added again (which is wrong); the user may be redirected to the start page.
The user did not enter the data correctly (there are error messages); reloading would cause the same message to be displayed again; redirect unacceptable.
I suppose you can issue a redirect only if the data validates, and display error messages in the other case.
If you have an option to migrate your CGI script to a modern web framework like Flask, Bottle, Django or Pyramid, I suggest you do so. This will give you session state and generally more convenient and modern environment.
A common way to do this is to store the pending messages for a given user on the server, associated with that user's session, and to display them the next time you deliver a page to that user.
Such messages are often called "Flash messages" (nothing to do with Adobe Flash) or "Session messages".
See the Django documentation for an idea of how you would do this in Django.
Your question is extremely confusing, because you say “press refresh” adds data. – You also don’t mention if your form is submitted via POST or GET (is it submitted at all??).
There is nothing that protects you from double entries (the user can always hit reload) if you don’t guard actively against them. One way is to deliver your form with some unique number and check if you already accepted submissions for that number.
And the other problem you face is as old as HTTP itself: session state. If you don’t want to start with session IDs or cookies, but need to carry your data through some pages, add all state to the URL all the time.
The new approach is to use AJAX, where your submit button is not going to submit classically anymore, but instead is going to execute some JavaScript in which you submit on a different (logical) connection, wait for the result and than change something in the still existing HTML page so that the user can see the result (e.g. adding a paragraph at a prominent place), but has the form still in front of him as is.

Categories

Resources