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
curl -XPOST 'localhost:9200/haystack/_close' | |
curl -XPUT "http://localhost:9200/haystack/_settings" -d'{ | |
"index": { | |
"analysis": { | |
"analyzer": { | |
"portugues_analyzer": { | |
"tokenizer": "standard", | |
"filter": [ | |
"lowercase", |
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 TransactionDbSerializerCreate(serializers.ModelSerializer): | |
user = serializers.ReadOnlyField(source='user.username', default=serializers.CurrentUserDefault()) | |
def validate(self, var): | |
username=var['user'].username #ERROR |
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 TransactionDbSerializerCreate(serializers.ModelSerializer): | |
user = serializers.ReadOnlyField(source='user.username', default=serializers.CurrentUserDefault()) | |
def validate(self, var): | |
username=var['user'].username #ERROR |
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 TransactionDbSerializerCreate(serializers.ModelSerializer): | |
user = serializers.ReadOnlyField(source='user.username', default=serializers.CurrentUserDefault()) | |
def validate(self, var): | |
username=var['user'].username #ERROR |
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 TransactionDbSerializerCreate(serializers.ModelSerializer): | |
user = serializers.ReadOnlyField(source='user.username', default=serializers.CurrentUserDefault()) | |
def validate(self, var): | |
username=var['user'].username #ERROR |
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
# Inside my template file | |
""" <form role="form" id="questionFormAdd" class="col-md-12"> | |
{% csrf_token %} | |
<input type="hidden" name="service" value="17" id="serviceId"> | |
<div class="question-input clearfix"> | |
<textarea class="form-control" rows="1" name="question" id="questionTextArea"></textarea> | |
</div> | |
</form>""" | |
##################################################### | |
#models.py |
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
name = models.CharField(max_length=32) | |
description = models.TextField(blank=True, | |
help_text='Seria Bom voce inserir uma descricao') | |
user=models.CharField(max_length=32) | |
img = ProcessedImageField(upload_to='services', | |
processors=[ResizeToFill(200, 200)], | |
format='JPEG', | |
options={'quality': 60}) | |
geometry = models.PointField(srid=4326) | |
objects = models.GeoManager() |
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
// meu diretório esta assim | |
Folder->djangoProject | |
Folder->djangoProject | |
Folder->app | |
Folder->static | |
Folder->uploads | |
Folder->services | |
setings.py | |
.... |
NewerOlder