-
Notifications
You must be signed in to change notification settings - Fork 0
/
populate_LAY.py
368 lines (318 loc) · 25.3 KB
/
populate_LAY.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# -*- coding: utf-8 -*-
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'LookAfterYourself.settings')
import django
django.setup()
from MainApp.models import Tip,Service, Post
def populate():
tips = [
{"title": "Learn how to calm your anxiety by relaxing the muscles in your body",
"tip": "Calm breathing and progressive muscle relaxation can you help to reduce some "
"of the anxious and tense feelings in your body.",
"tags": "ptsd anxiety general"},
{"title": "Know your limitations, but focus on your strong points",
"tip": "You probably can’t handle as much stress as other people."
"So maybe you don’t get as much done in a day. But the flip side of that "
"is that you’re probably a pretty patient human being.That’s going to make a lot "
"of people want to be your friend. I’m not sure why, but it seems like people with "
"mental illnesses are overrepresented in the brains and creativity department. "
"Autism often comes with great attention to detail and the same type of associative "
"thinking as schizophrenia. And we all know how many artists are bipolar.",
"tags": "anxiety"},
{"title": "Create Space",
"tip": "Ask yourself what you need on a daily basis, and find storage bins or closets for "
"things you don’t. Designate specific areas for things like keys, bills, and other items "
"that can be easily misplaced. Throw away things you don’t need.",
"tags": "adhd"},
{"title": "Take a Shower",
"tip": "not a bath, a shower. use water as hot or cold as u like. u dont even need to wash."
" just get in under the water and let it run over you for a while. sit on the "
"floor if you gotta.",
"tags": "general depression"},
{"title": "Addiction =/= Bad/Weak",
"tip": "If you fall back into old patterns (backslide) a bit, talk to someone as soon as "
"possible. There's nothing to be ashamed about, but it's important to get help soon so that "
"all of the hard work you put into your recovery is not lost.",
"tags": "addiction"},
{"title": "Staying Hydrated",
"tip": "It's recommended that you drink between 6-8 glasses of fluid per day. Water is a cheap "
"and healthy option",
"tags": "depression anxiety general"},
{"title": "Relax Before You Go To Bed",
"tip": "Do something calming. Breathing exercises. Muscle relaxation. Meditation.",
"tags": "general"},
{"title": "Use a calendar app or day planner",
"tip": "Effective use of a day planner or a calendar on your smartphone or computer can help you "
"remember appointments and deadlines. With electronic calendars, you can also set up automatic reminders "
"so scheduled events don’t slip your mind.",
"tags": "adhd"},
{"title": "Moisturise Everything",
"tip": "Use whatever lotion u like. unscented? dollar store lotion? fancy 48 hour lotion that makes u"
"smell like a field of wildflowers? use whatever u want, and use it all over.",
"tags": "depression"},
{"title": "Figure Out Who Will Accept You",
"tip": "A lot of us are charismatic in small doses. That gives people high expectations. But when we "
"can’t be “on” consistently enough to meet those expectations it feels like we’re letting people down. "
"There are some people you can be around all the time and others who are only able to deal with you "
"on good days. That’s okay. Every friendship has a different purpose. Sometimes you fit with someone "
"so well in some ways that it makes up for all the others.",
"tags": "ptsd ocd anxiety bipolar"},
{"title": "Change",
"tip": "Put on some clean and comfortable clothes. It will make you feel better than you imagine.",
"tags": "general"},
{"title": "Use Lists",
"tip": "Make use of lists and notes to keep track of regularly scheduled tasks, projects, deadlines, and "
"appointments. If you decide to use a daily planner, keep all lists and notes inside it. You also have many "
"options for use on your smartphone or computer. Search for “to do” apps or task managers.",
"tags": "adhd general"},
{"title": "Avoid High-Risk Situations",
"tip": "Some common high-risk situations are described by the acronym, HALT: (H)ungy (A)ngry (L)onely (T)ired.",
"tags": "addiction"},
{"title": "Don't Let People Treat You Badly",
"tip": "A lot of us are easy prey for abusive partners and “friends” who want to make everyone around them as "
"miserable as they are. I dated a controlling guy in high school who subtly tried to change my opinion "
"of my family. I was vaguely aware that he wasn’t a good person, but I was so flattered by the "
"attention that I put up with it until my parents wouldn’t let me see him anymore.",
"tags": "general"},
{"title": "Clean Something",
"tip": "doesn’t have to be anything big. organize one drawer of ur desk. wash five dirty dishes. do a load of "
"laundry. scrub the bathroom sink. ",
"tags": "general depression ocd"},
{"title": "Grounding",
"tip": "Grounding is a very helpful technique if you are experiencing flashbacks and you find yourself sometimes "
"losing touch with the present moment. Having this symptom of PTSD is not only terrifying for you, but it can also "
"be scary for people around you, such as friends and family. Grounding teaches you to stop losing touch with the "
"present moment by concentrating and focusing on the present or by directing your attention to something else.",
"tags": "ptsd"},
{"title": "Be Honest",
"tip": "An addiction requires lying. You have to lie about getting your drug, using it, hiding its consequences,"
" and planning your next relapse. An addiction is full of lying. By the time you've developed an addiction, "
"lying comes easily to you. After a while you get so good at lying that you end up lying to yourself. That's "
"why addicts don't know who they are or what they believe in.",
"tags": "addiction"},
{"title": "Deal With It Now",
"tip": "You can avoid forgetfulness, clutter, and procrastination by filing papers, cleaning up messes, or "
"returning phone calls immediately, not sometime in the future. If a task can be done in two minutes or less, "
"do it on the spot, rather than putting it off for later.",
"tags": "adhd"},
{"title": "Get Treatment",
"tip": "Please. Two of my friends committed suicide because they hadn’t dealt with their illnesses properly. "
"You might be ashamed, but there’s way more shame in hurting people who need you because you don’t "
"want to admit that you have a problem.",
"tags": "addiction depression eatingdisorder"},
{"title": "Blast Music",
"tip": " listen to something upbeat and dancey and loud, something that’s got lots of energy. sing to "
"it, dance to it, even if you suck at both.",
"tags": "general depression bipolar"},
{"title": "Break Tasks Down Into Smaller Steps",
"tip": "A common symptom of depression is the feeling of being overwhelmed even by ordinary day-to-day tasks. "
"Even getting out of bed and getting dressed can feel like a huge hurdle and people become more "
"withdrawn and less active as depression becomes more severe. The best way to overcome feeling "
"overwhelmed is to break down the activity in small, easier-to-achieve chunks.",
"tags": "anxiety depression ocd"},
{"title": "Make Yourself Some Food",
"tip": "don’t just grab a granola bar to munch. take the time and make food. even if it’s ramen. "
"add something special to it, like a hard boiled egg or some veggies. prepare food, it tastes way "
"better, and you’ll feel like you accomplished something.",
"tags": "general depression eatingdisorder"},
{"title": "Avoid Isolation By Connecting With People",
"tip": "People with depression often cut themselves off from the outside world. But becoming withdrawn and "
"less talkative can create a downward spiral. Connection is one of the six basic emotional needs "
"and when depression takes hold it is often the need that gets most neglected in favour of satisfying "
"the need for comfort through isolation.",
"tags": "depression general"},
{"title": "Make Something",
"tip": "write a short story or a poem, draw a picture, color a picture, fold origami, crochet or knit, "
"sculpt something out of clay, anything artistic. even if you don’t think you’re good at it.",
"tags": "general depression ocd anxiety"},
{"title": "Accept Personal Responsibility",
"tip": "The power of the mind is an amazing thing, and although pharmaceutical intervention is certainly "
"beneficial in cases of severe depression, individuals can work towards overcoming mild or moderate "
"depression faster if they start to take personal responsibility for their actions and behaviours. "
"This advice is not about “pulling yourself together” but more about what decisions need to be made "
"by the individual to make them feel more powerful and happy.",
"tags": "depression"},
{"title": "Go Outside",
"tip": "take a walk. sit in the grass. look at the clouds. smell flowers. put your hands in the dirt "
"and feel the soil against your skin.",
"tags": "depression"},
{"title": "Call Someone",
"tip": "call a loved one, a friend, a family member, call a chat service if you have no one else to call. "
"talk to a stranger on the street. have a conversation and listen to someone’s voice. if you can’t, text "
"or email or whatever, just have some social interaction with another person. even if you don’t say "
"much, listen to them.",
"tags": "general depression anxiety bipolar"},
{"title": "Have Regular Sleep Time",
"tip": "Getting a good night’s sleep is important for everyone but especially for those suffering from "
"depression. Conversely too much sleep (over eight hours) can exacerbate depression. Regular "
"sleeping hours are essential in managing mood and having a regular bedtime and rise time is "
"important. Go back to basics, set alarms, create a routine and introduce calming rituals before bed.",
"tags": "general"},
{"title": "Have Pets?",
"tip": "cuddle your pets if you have them/can cuddle them. take pictures of them. talk to them. tell them "
"how u feel, about your favorite movie, a new game coming out. anything you are excited about for the future.",
"tags": "general depression anxiety bipolar"}]
Services = [
{
"name": "Counselling and Psychological Services",
"acronym":"CAPS",
"description":"A UofG service that provides drop-in sessions, counselling and self-help. Located at 67 Southpark Avenue, they are open from 09:00-20:00 on Tuesday and Thurday and 09:00-17:00 on other weekdays.",
"phone_number":"+44 (0) 141 330 4528",
"email":"[email protected]",
"url":"https://www.gla.ac.uk/myglasgow/counselling/",
},
{
"name": "The Samaritans Glasgow",
"acronym":"The Samaritans",
"description":"A safe, confidential call-line to discuss anything on your mind. Available 24/7 without waiting lists and without costs. Also available at 210 West George Street for drop-ins from 09:00-20:00",
"phone_number":"116 123",
"email":"[email protected]",
"url":"https://www.samaritans.org/branches/samaritans-glasgow",
},
{
"name": "Breathing Space",
"acronym":"Breathing Space",
"description":"Sometimes our thoughts and feelings can overwhelm us. It helps to get some Breathing Space. Pick up the phone - we're here to listen.",
"phone_number":"0800 83 85 87",
"email":"[email protected]",
"url":"http://breathingspace.scot/",
},
{
"name": "National Health Service 24",
"acronym":"NHS 24",
"description":"Out-of-hour health advice for emergency situations",
"phone_number":"111",
"email":"[email protected]",
"url":"https://www.nhs24.scot/",
},
{
"name": "University of Glasgow's Nightline",
"acronym":"GU Nightline",
"description":"Nightline is a confidential telephone support and information service run for students, by trained student volunteers. We are available Monday to Friday from 7pm till 7am and we offer confidential listening and information to all students from Glasgow University.",
"phone_number":"0141 334 9516",
"email":"[email protected]",
"url":"https://www.gunightline.org/",
},
{
"name": "B-eat beating eating disorders",
"acronym":"B-eat",
"description":"We are a champion, guide and friend to anyone affected by eating disorders, giving individuals experiencing an eating disorder and their loved ones a place where they feel listened to, supported and empowered.",
"phone_number":"8088010811",
"email":"[email protected]",
"url":"https://www.beateatingdisorders.org.uk/",
},
{
"name": "No Panic",
"acronym":"NP",
"description":"No Panic is a registered charity which helps people who suffer from Panic Attacks, Phobias, Obsessive Compulsive Disorders and other related anxiety disorders.",
"phone_number":"8449674848",
"email":"[email protected]",
"url":"https://www.nopanic.org.uk/",
},
]
Posts = [
{
"title" : "Test Post",
"content": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis " \
"parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo," \
" fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium." \
" Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, " \
"enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam " \
"ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper " \
"libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. " \
"Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. " \
"Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. " \
"Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum " \
"ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu " \
"tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, " \
"mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et " \
"nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec " \
"sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Curabitur " \
"ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec " \
"posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, " \
"nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum " \
"sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. ",
},
{
"title": "Test Post # 1",
"content": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis " \
"parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo," \
" fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium." \
" Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, " \
"enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam " \
"ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper " \
"libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. " \
"Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. " \
"Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. " \
"Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum " \
"ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu " \
"tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, " \
"mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et " \
"nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec " \
"sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Curabitur " \
"ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec " \
"posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, " \
"nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum " \
"sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. ",
},
{
"title": "The 'One Hour Rule' I Use on Days When Mental Illness Makes It Hard to Get Out of Bed",
"content": "As much as I would love to be one of those people who jumps out of bed in the mornings, wide eyed, refreshed and ready to take on the day ahead, it just isn’t me. " \
"I am not a morning person at all. That being said, on the good days when I plan things to look forward to, or am in a good head space, mornings are inevitably easier. " \
"However, on the difficult mornings, my bed holds me hostage. I don’t want to face the day, I don’t want to wake up and I certainly don’t want to leave the cosy sanctuary " \
"of my blankets. " \
"" \
"But I have found something that helps. I call it the “one hour rule.” " \
"" \
"Within one hour of waking up, I have to be out of my bed. If I look at the clock when " \
"I wake up and it is 9 a.m., by 10 a.m., I cannot still be lying in bed. I am a competitive person, and even some gentle competition with my own brain helps me sometimes. " \
"" \
"I tell myself: Just try. Get out of bed and get up. If it doesn’t work, and in an hour you feel worse, then you can go back to bed. And sometimes, I will. And that’s OK. " \
"But I make myself try. Try to taste the day. I don’t have to like it, I just have to do it. " \
"" \
"I have to be up though. I have to be doing or moving or creating. It can work like a domino effect. If I am up, I may as well take a shower, may as well make some breakfast, " \
"and hey — seeing as I’m already up, I might just leave the house today. " \
"" \
"I can’t promise that it always works like this, but one thing I do know is that I always feel better for giving it a go. " \
"" \
"I encourage you to give yourself one hour, 60 minutes, 3,600 seconds. " \
"It might suck, and you may get out of your bed just to end up on the floor instead, or sitting on the landing, or you might make it to sit on the shower floor. But at least you tried. " \
"You got up and you gave today a chance. You did the absolute best that you could, and there is no shame in that. It does not go unnoticed. " \
"" \
"(credit: https://themighty.com/2017/05/one-hour-rule-mental-illness-getting-out-of-bed/",
},
]
servicesDict = {"services":Services}
tipsDict = {"tips": tips}
postsDict = {"posts": Posts}
for p, p_data in postsDict.items():
for p in p_data:
add_post(p["title"], p["content"])
for p in Service.objects.all():
print("- {0}".format(str(p)))
for s,s_data in servicesDict.items():
for s in s_data:
add_service(s["name"],s["acronym"],s["description"],s["phone_number"],s["email"],s["url"])
for s in Service.objects.all():
print("- {0}".format(str(s)))
for t, tip_data in tipsDict.items():
for x in tip_data:
add_tip(x["title"], x["tip"], x["tags"])
for x in Tip.objects.all():
print("- {0}".format(str(x)))
def add_post(title, content):
p = Post.objects.get_or_create(title=title, content=content)[0]
p.save()
return p
def add_service(name,acronym,description,phone_number,email,url):
s = Service.objects.get_or_create(name=name,acronym=acronym,description=description,phone_number=phone_number,email=email,url=url)[0]
s.save()
return s
def add_tip(title, tip, tags):
x = Tip.objects.get_or_create(title=title, tip=tip, tags=tags)[0]
x.save()
return x
if __name__ == '__main__':
print("Starting Population Script...")
populate()