This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.Xrm.Sdk; | |
namespace CRM.BusinessUnit.Plugins | |
{ | |
// Attributes used to simplify creating plugins | |
[StepMessage, StepEntity, SetpStage, StepMode, StepId] | |
[StepPreImage, PreImageId] | |
[StepPostImage, StepPostImageId] | |
public class org_ContactPreCreatePlugin : Pluginbase IPlugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gen_table_sql(table_obj): | |
row_len = length(table_obj) | |
query = "" | |
for index, row in enumerate(table_obj['columns']): | |
query.append(row) | |
# Needed so last line doesnt have a comma | |
if (index < length): | |
query.append(',\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gen_table_sql(table_obj): | |
# Joins all rows with a comma and a newline except for the last | |
query = ',\n'.join(table_obj['columns']) | |
return query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gen_table_sql(col_list): | |
# Joins all rows with a comma and a newline except for the last | |
query = ',\n'.join(col_list) | |
return query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def join_col_list(col_list): | |
'''Takes in column list and joins with commas to form sql statement''' | |
query = ',\n'.join(col_list) | |
return query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dictionary = {'string key': "string value", | |
('tuple', 'key'): {'dict': "value"}, | |
123: "Value for int key"} | |
keys = dictionary.keys() | |
print(keys) | |
# dict_keys(['string key', ('tuple', 'key'), 123]) | |
values = dictionary.values() | |
print(values) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initialization | |
dictionary = {'string key': "string value", | |
('tuple', 'key'): {'dict': "value"}, | |
123: "Value for int key"} | |
# Assign a key a new value | |
dictionary[123] = "New Value" | |
# Retrieve all keys from a dictionary | |
keys = dictionary.keys() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initialization | |
list = ["Lists", "Is", "Pretty", "Sweet"] | |
# Assigning an index a new value | |
list[1] = "Are" | |
# Extending a list | |
list.append("Cool") | |
# Removeing from the end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
posts = [ | |
{ | |
'Post': { | |
'title':'Other today post', | |
'date': 43750, | |
'claps': 200 | |
} | |
}, | |
{ | |
'Post': { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DiscordHandler(logging.Handler): | |
""" | |
Custom handler to send certain logs to Discord | |
""" | |
def __init__(self): | |
logging.Handler.__init__(self) | |
self.discordWebhook = DiscordWebhook(url=config.DISCORD_URL) | |
def emit(self, record): | |
""" |
OlderNewer