Coverage for crateweb/userprofile/migrations/0001_initial.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-08-27 10:34 -0500

1""" 

2crate_anon/crateweb/userprofile/migrations/0001_initial.py 

3 

4=============================================================================== 

5 

6 Copyright (C) 2015, University of Cambridge, Department of Psychiatry. 

7 Created by Rudolf Cardinal (rnc1001@cam.ac.uk). 

8 

9 This file is part of CRATE. 

10 

11 CRATE is free software: you can redistribute it and/or modify 

12 it under the terms of the GNU General Public License as published by 

13 the Free Software Foundation, either version 3 of the License, or 

14 (at your option) any later version. 

15 

16 CRATE is distributed in the hope that it will be useful, 

17 but WITHOUT ANY WARRANTY; without even the implied warranty of 

18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

19 GNU General Public License for more details. 

20 

21 You should have received a copy of the GNU General Public License 

22 along with CRATE. If not, see <https://www.gnu.org/licenses/>. 

23 

24=============================================================================== 

25 

26**Userprofile app, migration 0001.** 

27 

28""" 

29 

30from __future__ import unicode_literals 

31 

32from django.db import migrations, models 

33from django.conf import settings 

34 

35 

36class Migration(migrations.Migration): 

37 

38 dependencies = [ 

39 ("auth", "0006_require_contenttypes_0002"), 

40 ] 

41 

42 operations = [ 

43 migrations.CreateModel( 

44 name="UserProfile", 

45 fields=[ 

46 ( 

47 "user", 

48 models.OneToOneField( 

49 related_name="profile", 

50 to=settings.AUTH_USER_MODEL, 

51 on_delete=models.CASCADE, 

52 serialize=False, 

53 primary_key=True, 

54 ), 

55 ), 

56 ( 

57 "per_page", 

58 models.PositiveSmallIntegerField( 

59 default=50, 

60 choices=[ 

61 (10, "10"), 

62 (20, "20"), 

63 (50, "50"), 

64 (100, "100"), 

65 (200, "200"), 

66 (500, "500"), 

67 (1000, "1000"), 

68 ], 

69 verbose_name="Number of items to show per page", 

70 ), 

71 ), 

72 ( 

73 "line_length", 

74 models.PositiveSmallIntegerField( 

75 default=80, 

76 verbose_name=( 

77 "Characters to word-wrap text at in results" 

78 " display (0 for no wrap)" 

79 ), 

80 ), 

81 ), 

82 ( 

83 "collapse_at", 

84 models.PositiveSmallIntegerField( 

85 default=400, 

86 verbose_name=( 

87 "Number of characters beyond which results field" 

88 " starts collapsed (0 for none)" 

89 ), 

90 ), 

91 ), 

92 ( 

93 "is_developer", 

94 models.BooleanField( 

95 default=False, 

96 verbose_name="Enable developer functions?", 

97 ), 

98 ), 

99 ("title", models.CharField(max_length=20, blank=True)), 

100 ( 

101 "address_1", 

102 models.CharField( 

103 max_length=100, 

104 blank=True, 

105 verbose_name="Address line 1", 

106 ), 

107 ), 

108 ( 

109 "address_2", 

110 models.CharField( 

111 max_length=100, 

112 blank=True, 

113 verbose_name="Address line 2", 

114 ), 

115 ), 

116 ( 

117 "address_3", 

118 models.CharField( 

119 max_length=100, 

120 blank=True, 

121 verbose_name="Address line 3", 

122 ), 

123 ), 

124 ( 

125 "address_4", 

126 models.CharField( 

127 max_length=100, 

128 blank=True, 

129 verbose_name="Address line 4", 

130 ), 

131 ), 

132 ( 

133 "address_5", 

134 models.CharField( 

135 max_length=100, 

136 blank=True, 

137 verbose_name="Address line 5 (county)", 

138 ), 

139 ), 

140 ( 

141 "address_6", 

142 models.CharField( 

143 max_length=100, 

144 blank=True, 

145 verbose_name="Address line 6 (postcode)", 

146 ), 

147 ), 

148 ( 

149 "address_7", 

150 models.CharField( 

151 max_length=100, 

152 blank=True, 

153 verbose_name="Address line 7 (country)", 

154 ), 

155 ), 

156 ("telephone", models.CharField(max_length=20, blank=True)), 

157 ( 

158 "is_consultant", 

159 models.BooleanField( 

160 default=False, verbose_name="User is an NHS consultant" 

161 ), 

162 ), 

163 ( 

164 "signatory_title", 

165 models.CharField( 

166 max_length=255, 

167 verbose_name=( 

168 'Title for signature (e.g. "Consultant' 

169 ' psychiatrist")' 

170 ), 

171 ), 

172 ), 

173 ], 

174 ), 

175 ]