This file contains hidden or 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
DROP SCHEMA public CASCADE; | |
CREATE SCHEMA public; | |
GRANT ALL ON SCHEMA public TO db_user; | |
GRANT ALL ON SCHEMA public TO public; |
This file contains hidden or 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
p = "Object for which change is to be " | |
for i in p.history.all(): | |
previous = i.prev_record | |
if previous: | |
delta = i.diff_against(previous) | |
for change in delta.changes: | |
print("{} user changed {} from {} to {}".format(i.history_user, change.field, change.old, change.new)) | |
else: | |
print("{} created this item") |
This file contains hidden or 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
ssh-keygen -t rsa -b 4096 -C "your_email_id" | |
ssh-add ~/.ssh/id_rsa | |
copy content in .ssh/id_rsa.pub and paste in "Add SSH Key" option in your profile. | |
cd to your git repository. | |
git remote -v | |
git remote set-url origin <git_ssh_clone_url> |
This file contains hidden or 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
<!-- | |
/((((((\\\\ | |
=======((((((((((\\\\\ | |
(( \\\\\\\ | |
( (* _/ \\\\\\\ | |
\ / \ \\\\\\________________ | |
| | | </ ((\\\\ | |
o_| / / \ \\\\ \\\\\\\ | |
| ._ ( \ \\\\\\\\\\\\\\\\ | |
| / / / \\\\\\\ \\ |
This file contains hidden or 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
ssh -R 80:localhost:8000 ssh.localhost.run |
This file contains hidden or 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
{% for widget in form.field_name %} | |
<tr> | |
<th> | |
<label for="{{widget.id_for_label}}"> | |
<input type="{{widget.data['type']}}" name="{{widget.data['name']}}" value="{{widget.data['value']}}" {% if widget.data['selected'] %}selected{% endif %} {% for k, v in widget.data['attrs'].items() %} {{k}}="{{v}}" {% endfor %}> | |
</label> | |
</th> | |
<td> | |
{{widget.choice_label}} | |
</td> |
This file contains hidden or 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
qs = ProductCategory.objects.all() | |
slug_list = [item['slug'] for item in cat_list if item['slug'] in qs_slugs] | |
preserved = Case(*[When(slug=slug, then=pos) for pos, slug in enumerate(slug_list)]) | |
qs= qs.order_by(preserved) |
This file contains hidden or 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
<button type="button" class="btn btn-success js-create-supplier" data-url="{% url 'supplier:modal-create' %}"> | |
<span class="glyphicon glyphicon-plus"></span> | |
New Supplier | |
</button> | |
<div class="modal fade" id="modal-popup" role="dialog"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
</div> | |
</div> | |
</div> |