Thursday, November 11, 2010

Dynamic buttons for selling tickets

I have just finished configuring buttons for marking a ticket as 'sold' and 'attending'. They appear on the right side, next to each row of tickets. If you want to sell a ticket (mark a ticket as sold), just click on the cart button and it will be saved on the database and marked automatically. In case you made a mistake and want to undo this action, just click on the button again and it will be deleted on the database. The same mechanism happens for the 'attending button', whose symbol is a person icon.

Nevertheless, I have found a problem. I have realized that when I move to the next pages of the table of Ticket sell module, none of these buttons appear to be configured with JQuery. This is why I haven't made a commit yet. I'll try to resolve this conflict tonight.

Sunday, November 7, 2010

Site Creation


Even though we’ve been working on the site functionality for the past couple of weeks we didn’t really spend any time working on the site, so while some are working on functionality and integration I decided to start working on the main .html and css files and also modify the existing .html and css files we are using from JQuery.

The first step was to create the parent template, so according to the design we had planned I made an Index xhtml page trying to follow as much of w3c standards I could remember, after tweaking the css style page for a while I decided to give it a go and try it in the actual site, this is where I encounter a major “problem”, the content block wasn’t being displayed, I tried to change the pages as much as I could but I was getting the same error all the time, after an hour or so of wasting my time I realized that JQuery was only going to display the content if the div css tag was named content, and nothing else.

After making that work, I realized that a lot of the .html files we had had some css inside them, so my styles were being changed from different sources and everything was resulting in a big mess, I had to track down those .html files and change the style lines that were messing up my design, after achieving this, I tweaked the .css and html file a little more, changed some imaged and made some new ones, for now I think the site is looking good, but there’s still some room for improvement.

Unit Tests so far..

Unit tests in this kind of systems might be tricky to properly build, not because their difficult to create, but the real functionality of Unit test in dynamic web pages is yet to be seen clearly. The only thing we can really do so far is to "AssertTrue" values with the database, to check if the values are being correctly stored in the database. There is no way to check if our “modify or delete” events are performing correctly, since we can’t really change the database data using these methods from the test file.


This is mainly because Django has a lot of the functionality we need already built-in, so were just using those forms and relying on Django. We can probably test some Django API to see if the forms,etc. are working correctly, but I think this defies the purpose of using Django, so unless we start creating a more hierarchical structure (which I don’t think we will in this project) Unit Tests are becoming just a way to see if the methods are properly storing data in the database.

Ticket sell

I have been working on the 'ticket sell' module interface. For this I used something called dataTables, which helped me to display the tables in a more stylish way. Tickets of the event are showed automatically inside that table and its buyer too. I also added some buttons next to each row with option like set a ticket as sold, set that ticket as attending to the event and setting the buyer of the ticket. These buttons are not linked yet with the functions already defined in python to perform such functionality.

In whole system we are loading content dynamically (so navigation could be easier for users), but it has been causing some issues.

Saturday, November 6, 2010

These days I have been working in the assign tickets to the person in charge section. To do this I had to make some methods:

AssignTicketsForm: This one goes in forms.py.

AssignTickets: This one goes in views.py.

In general, the function of these methods is to set the person in charge of selling these tickets. A screen with all the current tickets of the event will appear and a field where the user can write the name of the seller. This will be saved in the seller variable of the ticket. The user can select all the tickets that will be under his charge by using the Ctrl key.

Problems in the process of a better design


We improved the design to raise the experience of the user. We put much emphasis in this because we want the user doesn’t make too much effort to understand our system. We changed some files like: mainInterface.html, index.html, baseEventTabs.html, eventTabs.html and indexAux.htm. These files are those who assemble all the features that our system provides.

One of the things that we changed for previous versions is the way the index looks. We add some logos: the university (ITESM CEM), the computer science’s student group (AESC) and the entity responsible for coordinating all activities of the students group (AGE). We also gave a welcome message.

This changes took some time because all the problems that we had with css. We had some problems with the tags of the files because those tags have already been used by the css file of the libraries that we are using of jQuery. After some research on the official web page of jQuery and some blogs we finally resolved that problem. Actually we are having some problems with the library of dataTable of jQuery that we are adding to our system because this library is changing some tags that we have already defined.

Wednesday, November 3, 2010

Adding and deleting tickets

I recently finished the adding tickets part. I had to simplify it: by now if an user inserts a range of tickets which already exists, it overwrites them, making them to loose their previous values. I'm looking forward to improve this functionality later, by validating some other cases.

Also I added a new functionality, which is deleting tickets. The user may select (from a multiple choice field) which tickets are needed to be deleted.

I had a hard time on sending parameters to a form. One of the problems is that whenever a form receives a parameter (like eventId, for example), the is_valid method returns that the form is invalid, so nothing is done.