×

Top 30 TurboGears Framework Interview Questions for 2024

1) What is TurboGears Framework?

TurboGears is a Python Framework. It is used to create rapid web application. It consists of several WSGI (Web Server Gateway Interface) components. It is developed by Kevin Dangoor in 2005.

2) In which language TurboGears was written?

TurboGears was written in Python programming language.

3) What is MVC (Model View Controller) in TurboGears?

MVC model is a software design pattern. It is used to develop web applications. It consists of three parts:
  • Model: It is a business entity which is used to represent the application data.
  • View: It is the presentation layer of MVC.
  • Controller: Request sent by the user always scatters through controller and its responsibility is to redirect to the specific view using View () method.

4) What is the stable version of TurboGears?

The stable version of TurboGears is 2.3.10 and released on 4 December 2016.

5) What are the latest libraries and tools to built TurboGears?

There are various libraries and tools to built TurboGears that are:
  • SQLAlchemy
  • Genshi
  • ToscaWidgets
  • Gearbox

6) What is SQLAlchemy in TurboGears?

In TurboGears, SQLAlchemy is an open source SQL kit that provides Object relation mapping (ORM) for Python code.

7) What are the TurboGears project directories?

TurboGears project directories are listed below table:
Config It is used to project setup and configuration.
Controllers It manages controller the logic of web application.
i018n It supports the languages of translation files.
Lib It provides utility python functions and classes.
Model: It contains database models.
PublicStatic Files It contains CSS, JavaScript and images.
Templates It manages the templates exposed by our controllers.
Tests It is used to test the project.
Websetup It provides the function to execute at application setup.

8) What is the default files installed at the time of project set up?

The following default files are installed at the time of project set up:
  • Beaker
  • Genshi
  • zope.sqlalchemy
  • sqlalchemy
  • alembic
  • repoze.who
  • tw2.forms
  • tgext.admin = 0.6.1
  • WebHelpers2
  • babel

9) What are the default port supported by TurboGears?

TurboGears supported by default port 8080.

10) What are the HTTP methods of TurboGears?

HTTP methods of TurboGears are:
HTTP Methods Descriptions
GET It is used to sends data in unencrypted form to the server.
HEAD It is same as GET
POST It is used to send HTML form data to server.
PUT It replaces all current representations of the target resource with the uploaded content.
DELETE It removes all current representations of the target resource given by a URL

11) What is the use of ToscaWidgets2 and its module?

ToscaWidgets2 is used to define the form field into Python script and render them into a HTML Template. The following modules are:
  • tw2.core: It provides core functionality.
  • tw2.forms: It is a basic forms library that contains widgets for fields, field sets and forms.
  • tw2.dynforms: It contains dynamic forms functionality.
  • tw2.sqla: It is an interface for SQLAlchemy database.

12) What are the various validator classes in TuroGears?

There are various validator classes in TurboGears:
Types of Validators Descriptions
LengthValidator It is used to check prescribe length.
RangeValidator It is used to check the range of the field.
IntValidator It is used to validate the integer types data.
OneOfValidator It is used to select a value from the available options in the list only.
DateValidator It avoids the user to input an invalid date.
EmailValidator It avoids the user to input an invalid email.
UrlValidator It validates the user input for a valid URL.
MatchValidator It is used to confirm whether the value of field is matched with the other.

13) What is ORM in TurboGears?

In TurboGears, ORM stands for Object Relational Mapping. It is a technique of mapping object parameter to underlying RDBMS table structure.

14) What are the CRUD Operations Methods in TurboGears?

In TurboGears, The CRUD operation methods are:
  • DBSession.add(model object): It is used to insert a record into mapped table.
  • DBSession.delete(model object) : It is used to delete the records from the table.
  • DBSession.query(model).all(): It is used to retrieve all the records from table.

15) What are Paginations in TurboGears?

TurboGears provides a convenient decorator called paginate(). It is used to divide the output in the pages. The number of records per pages is decided by value of items_per_page attribute.

16) Which template engine is used to construct the front-end of TG application?

Genshi template engine is used to construct the front-end of TG application.

17) Which method is used to map the root of our first application?

Index() method is used to map the root of our first application.

18) Which package is used to create of web widgets directly from the database schema?

Sprox package is used to create of web widgets directly from the database schema.

19) Which database supports TurboGears?

TurboGear supports MongoDB and SQL dbms database.

20) What are the PyMongo tools to work with MongoDB?

There are various PyMongo tools to work with MongoDB that are listed below: Declarative Models
  • Schema Validation and Conversion
  • Schema Evolution
  • Pure InMemory MongoDB Implementation
  • Unit of Work
  • Identity Map
  • One-To-Many, Many-To-One and Many-To-Many Relations

21) What are the ways to plug behavior inside the existing application in TurboGear?

In TurboGear, there are three ways to plug behavior inside the existing application.
  • Hook
  • Controller Wrapper
  • Application Wrapper

22) Which command is used to create a pluggable application?

The following code is used to create a pluggable application.
gearbox quickstart-pluggable plugtest

23) What is a RestController in TurboGear?

In TurboGear, RestController is a mechanism to access the request's method like GET, POST, PUTand many more.

24) Which method is used to render the page in TurboGear?

In TurboGear, @expose() decorator method is used to render the [age.

25) What is Kajiki in TurboGear?

In TurboGear, Kajiki provides a XML-based template language. It is inspired by Kid and Genshi.

26) How can we create a Text Field object?

We can create a Text Field object by using following constructor.
twf.TextField(size, value = None)

27) What is the default port of TurboGear?

The default port of TurboGear is 8080.

28) What is Scaffolding?

Scaffolding is the process of creating a new component of our web application through a template or preset.

29) How to create an Extension in TurboGear?

The following code is used to create an Extension in TurboGear.
$ gearbox tgext -n myextension -a "My Name" -e "my@email.com"

30) How to store Flash Message?

The following code is used to store Flash Message.
tg.flash('Message', 'status')

31) How to create TurboGear admin?

TurboGear admin is created as object of AdminController class. Example:
from tgext.admin.controller import AdminController  
class RootController(BaseController):  
   admin = AdminController(model, DBSession, config_type = TGAdminConfig)

32) What is Repoze in TurboGear?

In TurboGear, Repoze is used to handle security (identification and authentication). Users can define authorization rules based on predicates attached to controllers

Related Topics

Top 30 SASS Interview Questions for 2024

1) What is Sass? SASS: Systematically Awesome Style Sheets is an extension of CSS. It is also known as CSS pre-processor which helps to reduce repetition with CSS and saves time. It is...

4 minutes read.

Top 18 Blockchain Interview Questions and Answers for 2024

Top 20 Commonly Asked Blockchain Interview Questions and Answers 1. What do you understand by Blockchain? Blockchain is a chain of blocks made up of digital pieces of information or can be defined as...

6 minutes read.

SSIS Interview Questions and Answers

Q.1 What is SSIS? SQL Server Integration Service (SSIS) is a component of Microsoft SQL Server. It is a powerful ETL tool that is used for building enterprise-level data transformation and...

5 minutes read.

Top 30 Zend Framework Interview Questions for 2024

1) What is Zend Framework? Zend is an open source, object-oriented web application framework. It is implemented in PHP 5. It was developed in 3 March 2006. 2) What is the use...

6 minutes read.

Top 15 Highcharts Interview Questions for 2024

1) What is Highcharts? Highcharts is a JavaScript based charting library. It is used to enhance web applications by adding interactive charting capability. Highcharts supports a wide range of charts. Charts are drawn using...

2 minutes read.

Top 15 ASP.NET MVC Framework Interview Questions for 2024

1) What is ASP.NET MVC Framework? ASP.NET MVC framework is a software architecture pattern for developing web applications. It is used to split the application's implementation logic into three components: models,...

4 minutes read.

VB.NET Interview Questions

1) What is VB.NET? VB.NET stands for Visual Basic .NET. It is an object oriented programming language. It is implemented on .NET framework and launched by Microsoft in 2001. 2) Who is...

3 minutes read.

Top 30 Python Interview Questions for 2024

1) What is Python? Python is a high level, interpreted and object-oriented programming language. It is easy to learn and supports multiple programming patterns. It is also known as powerful and versatile...

6 minutes read.

Top 15 Struts Interview Questions for 2024

1) What are the Features of Struts 2? Features of Struts 2 are: Configurable MVC components POJO based actions AJAX support Integration support Various Result Types Various Tag support Theme and...

3 minutes read.

Top 15 Servlet Interview Questions for 2024

1) What is Servlet? It is a technology used to create web applications. It is a web component which is used to create dynamic web pages. It consists of many interfaces and classess...

2 minutes read.

Top 15 SVG Interview Questions for 2024

1) What is SVG? SVG stands for Scalable Vector Graphics, It is XML based format used to draw dimentional vector images. It is a W3C standard. SVG supports all image formats. 2) What are...

2 minutes read.

Top 22 MariaDB Interview Question for 2024

1) What is MariaDB? It is a community based database devoloped by MySQL Devolopers. It provides same features as MySQL also, can be said that it is a replacement of MySQL. 2)...

3 minutes read.

Top 30 Fortran Interview Questions for 2024

1) What is Fortran? Fortran is general purpose, high-level programming language which is used for numeric and scientific computing. 2) What are the features of Fortran programming language? Features of Fortran language are: ...

4 minutes read.

Top 15 C Interview Questions for 2024

1) What are different storage class specifiers in C? Register,auto, static, extern are the storage class specifiers in C. 2) What is scope of a variable? How are variables scoped in C? Scope...

3 minutes read.

Top 25 DB2 Interview question for 2024

1) Give breif detail about DB2? DB2 is a Relational Database Management System developed by IBM. It supports Object Oriented features and non-relational structures with XML. 2) Enlist the types of datatypes...

3 minutes read.

Top 15 PostgreSQL Interview Questions for 2024

1) What is PostgreSQL? PostgreSQL is a most advance open source database system. PostgreSQL is an object Oriented Relational Database Management System (ORDBMS). PostgreSQL source code is available free of charge...

3 minutes read.

Top 15 Data structure & Algorithm Interview Questions for 2024

1) What is Data Structure? Data structure is a way of storing, collecting and organizing data into the main memory. It makes data access more efficient and increase performance. Array, List, Queue...

3 minutes read.

Top 15 CherryPy Interview Questions for 2024

1) What is CherryPy? CherryPy is a web framework used for Python. It provides a friendly interface for Http protocol for Python developer. 2) Why we use CherryPy? CherryPy has following strength: Simplicity: It...

3 minutes read.

Top 30 SQL Interview Questions for 2024

1. What is SQL? Ans. SQL stands for Structured Query Language.  It is a standard computer language for accessing, storing, and manipulating data stored in the relational database. SQL become an International Standard Organization (ISO)...

11 minutes read.

Top 30 SQLite Interview Question for 2024

1) What is SQLite? It is an in-process library which implements self-contained, serverless, zero-configuration, transactional SQL database. 2) What datatype does SQLite supports? It uses dynamic typing and data can be stored in...

5 minutes read.