LIULIANG's Blog

WEEK 13 BLOG

LIULIANG
Published: 09/05/2022

Week 13 is 8.29-9.4

Because 9.5 began to submit the final results, I discussed this with my mentor Turnbull this week. So in this week's blog, I only summarize the completed functions and the next functions.

What did you do this week?

Fixed bug of highlight modification.

Added the function of flexibly rendering headers according to the incoming data.

Flexibly render the form content according to the incoming data.

Modified the saving logic of data: only modify the attributes displayed on the page.

Migrated static list and dictionary to utils.py.

The back-end part of the display filter is completed.

What is coming up next?

List style page part.

Clone list.

The list clone is migrated to the mailman client.

View Blog Post

WEEK 12 BLOG

LIULIANG
Published: 08/29/2022

Week 12 is 8.22-8.28

The original work of this week should be list style. However, as the final evaluation is approaching, I will complete the basic functions first, and then complete these extended functions.

What did you do this week?

This week I adjusted the rewritten HTML page. There are many data types of list attributes data, among which list data will be displayed in brackets [] in the textarea. This causes the user to manually delete the brackets, otherwise the data returned to the background will not meet the requirements. This will cause the application modification to fail.

The method I use is to display the list attributes in a loop on the page, and re encapsulate the text area content into a list when it returns to the backend.

I have completed the export function. A button is added on the page to export the selected list. If the list is not selected through the check box, the JSON file will not be generated.

At the same time, I am working on the import function. The process of import function is to select a file and parse JSON data, return the corresponding attributes to the backend, and then create a corresponding list according to the obtained content. At present, I have completed the file parsing function.

What is coming up next?

I will discuss with my tutor about importing JSON files and cloning lists, and will complete these two main functions next week.

Prepare the documents required for the final evaluation.

If it is completed smoothly, I will continue to work on UI design.

View Blog Post

WEEK 11 BLOG

LIULIANG
Published: 08/22/2022

Week 11 is 8.15-8.21

I got gastroenteritis on 8.19. I worked less this week than usual.

What did you do this week?

8.15, I determined two methods for the next work.

8.17, I reported the current scheme to my tutor Turnbull. My tutor suggested that using the form set. So I used the form set to start regenerating the HTML page. In the process of browsing the official technical documents, I have never found a way to highlight the modification.

It may be very simple to realize the function of displaying attributes, but the difficulty of realizing other functions needs to be considered. So I still prefer to use HTML language to generate pages. Implement subsequent functions in combination with JS.

I learned CSS, bootstrap, JS, jQuery

I rewrite the code that generates the page. At the same time, the method of application modification is redesigned.

What is coming up next?

Next I will work on the list style.

I stopped and investigated the method when determining the follow-up method. It took me a few days, but it may speed up the follow-up development, which is worth it.

View Blog Post

WEEK 10 BLOG

LIULIANG
Published: 08/15/2022

Week 10 is 8.8-8.14.

I started working on 8.10.

What did you do this week?

First, I thought about the next steps. Currently, the functions to be completed are list style, list cloning, and applying modification. The next task is to export the list configuration to the JSON file and import the JSON file migration configuration. In these steps, the applying modification has the highest priority. Only after the applying modification function is completed, I can realize list cloning and more modification and management.

So I first worked on the applying modification part. I finished this part very quickly. The test uses 5 lists. After the form is submitted by clicking the submit button on the page, all data will be returned to the back end. The value returned by request.POST is a list corresponding to the key. The list stores the value of five lists. I used the loop method and applied all the changes.

At this time, there is a problem. Only one radio button can be selected from the data in one column and only one data is returned. This has always been a problem. I found the cause of the problem in form = form _ class (initial = initial_data,mlist = m_list, auto_id = True) to generate a form. In fact, it is rendered into HTML code according to the class of the form and the initial data. However, the IDs generated automatically by these codes in the process of generating the list are all from 0. This results in the same id for all fields. I spent four days looking for a solution to this problem.

1. I try to generate all the forms directly. This problem can be solved without using the loop function. So I tried to merge the initial data of all the lists and use the form = form _ class function generates a form. But I failed. This function can't recognize a dictionary with a list value, and finally only displays a list.

2. I found a way to customize the id. By defining the attr of the widget and adding the id, can generate a customized id. First, I modified the id, but the situation has not changed. All radio buttons have the same customize id. I try to change the id to str (list_id) + field_ name to generate a unique id. I tried to customize functions, initialize classes, and modify variables across files, but none of them can achieve the function I want to complete. I guess it's because of the list_ form.py is a static model file, which cannot be modified dynamically.

3. I try to find a way to realize this function in the templae language. But I didn't find it. All the functions are used to display data and cannot be modified.

After nearly five days of exploration, up to now, 8.15, I have two ideas to complete this function.

Idea 1: replace the radio button with a drop-down menu. In the whole table, only the radio button part has a problem. The pull-down menu that can also realize the selection function can be used normally. Radio buttons with only two options can also be changed into drop-down menus to realize functions.

Idea 2: rewrite the HTML page. Because the form function is used to automatically render the HTML code, it is difficult for me to modify the id. At the same time, this problem also appears in other parts, but there is a problem with the use of radio buttons. However, in consideration of the need to implement clone list, change list style, export list, import content and other functions, this problem may affect the implementation of subsequent functions and take more time. There are many functions to be implemented on this page, so I prefer to write HTML pages directly for generating tables.

 

What is coming up next?

Rewrite the table in the template file using HTML language.

Practice of creating checkboxes and lists.

Realize batch modification.

Realize the function of clone list.

View Blog Post

WEEK 8(Midterm Evaluation)and WEEK 9 BLOG

LIULIANG
Published: 08/09/2022

The week 8 is 7.25-7.31.

In the week 8, I started my midterm evaluation. But since I had not made progress in the right place before, I continued to work at the beginning of this week. Tutor Turnbull gave me important guidance on how to use Django forms. I created a new page to display the attributes. At the same time, I successfully used the function of Django form to create all_attributes form. Use text boxes to display data for all attributes. However, there is an issue in getting all list id. I didn’t find an suitable method to obtain all the list numbers.

I finished the page displaying the contents of a list on 7.28. And upload this to GitHub as the material for the mid-term evaluation.

When I didn't get the results of the midterm evaluation, I continued my work. I don't want to interrupt my current state of concentration.

7.29 for the list id, I decided to start with the database. Find the database that stores the data, and then read the relevant code to find the way to get the data. So I found all the list id in one database of Hyperkitty. The database in Postorius does not have list id. By calling the data of Hyperkitty, I successfully obtained the all list id and displayed the attrbutes of all lists.

I reported this result to my tutor, who suggested that I had better use the functions of components independently, because each component may be deployed in different places. Therefore, my method may not get the returned result during the actual operation.

I have looked at the source code carefully. It is true that they are all developed independently and will not call each other. So I began to look for other ways to solve this problem.

I began to understand the knowledge of REST and tried to use it to solve this problem. This is what I didn't learn and pay attention to during my previous practice.

Thus, the week 8 is over. I've been working almost all week. I focus on the program and I'm happy. It's just that I stopped almost all my other work.

 

The week 9 is 8.1-8.7

This week begins to make up for the learning and research tasks delayed last week. I have another exam on 8.9.

At the end of the middle term, I got the evaluation of my tutor. The tutor pointed out my problems, and I had a deep reflection on them. I don't want the work in the second half to be as bad as before.

The main work this week is to make up for my other tasks, continue to work, think about the next work, and prepare for the exam.

This week, I learned REST in my spare time of other tasks, and successfully used the postorius function in 8.5 to obtain all list id and successfully display all list attributes. I gave this report to my tutor, who confirmed my method and finally completed this function. At the same time, we discussed the next work. Next, we need to optimize the interface logic from the user's point of view, and possibly modify the database.

I didn't work at the weekend because the exam was near.

 

Next:

1. Optimize the user interface and list style.

2. Fix some issues, check box display issue, radio box issue.

3. Link the database and use the API to operate the database.

4. Add list cloning function.

5. From the user's point of view, add convenient control functions. For example, how to quickly modify the specified list when there are 2000 lists. (add a function similar to shopping cart?)

6. Apply modifications.

View Blog Post
DJDT

Versions

Time

Settings from gsoc.settings

Headers

Request

SQL queries from 1 connection

Static files (2312 found, 3 used)

Templates (28 rendered)

Cache calls from 1 backend

Signals

Log messages