Django Flashcards

1
Q

manage.py

A

program you run to modify your project

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

db.sqlite

A

your database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

cs3550/urls.py

A

routes URLs to the functions that generate them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

cs3550/settings.py

A

global project settings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

models.py

A

describes what you will store in the database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

migrations/

A

tracks changes to the database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

views.py

A

renders the HTML templates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

IntegerField

A

Stores integers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

FloatField

A

stores floating-point numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

DecimalField

A

stores decimal numbers, use for money over float.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

CharField

A

stores short strings, pass max_length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

TextField

A

stores long strings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

EmailField

A

store an email address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

URLField

A

stores URLs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

ImageField

A

images

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

FileField

A

storing files

17
Q

DateTimeField

A

stores a specific instant in time

18
Q

DateField

A

stores a calendar date

19
Q

on_delete=models.RESTRICT

A

raise an error and prevent deletion

20
Q

on_delete=models.CASCADE

A

also delete the object with the foreign key

21
Q

on_delete=models. SET_NULL

A

must set null=True on the ForeignKey

22
Q

floatformat:digits

A

Prints a float or decimal with that many decimal digits

23
Q

date:“D d F Y”

A

Writes a date in a specific format

24
Q

timesince:time

A

Prints how much time passed between two times

25
Q

join:separator

A

Prints a list of items with the separator in between

26
Q

dictsort:“key”

A

Sorts a list of objects or dictionaries

27
Q

length

A

Prints the length of a list

28
Q

pluralize

A

Prints an “s” if a number is not equal to 1

29
Q

filter

A

Keep only objects that satisfy a property

30
Q

exclude

A

Remove objects that satisfy a property

31
Q

order_by

A

Sort by a field or computed value

32
Q

reverse

A

Reverse the order

33
Q

intersection

A

Only objects that satisfy a second query as well

33
Q

union

A

Combine results from two queries

34
Q

distinct

A

Remove duplicate objects from the query