Commit b13611bb authored by Ben Waters's avatar Ben Waters

adding user serializer

parent 0a54fbd3
<?xml version="1.0" encoding="UTF-8"?>
<component name="dataSourceStorage">
<data-source source="LOCAL" name="Django default" uuid="66f3b85e-5b04-4deb-9943-1d97d6c180a6">
<database-info product="" version="" jdbc-version="" driver-name="" driver-version=""/>
</data-source>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" hash="1006508842">
<data-source source="LOCAL" name="Django default" uuid="66f3b85e-5b04-4deb-9943-1d97d6c180a6">
<driver-ref>postgresql</driver-ref>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://127.0.0.1/ff</jdbc-url>
<user-name>ffuser</user-name>
<user-password>df9bdf9edfccdfccdf8b</user-password>
<libraries />
</data-source>
</component>
</project>
......@@ -2,18 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="d9cecc44-3001-4c5b-a72e-16df32873bd9" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/.name" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/encodings.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/friendfinder.iml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/modules.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/scopes/scope_settings.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/geo/admin.py" afterPath="$PROJECT_DIR$/geo/admin.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/geo/models.py" afterPath="$PROJECT_DIR$/geo/models.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/ffREST/urls.py" afterPath="$PROJECT_DIR$/ffREST/urls.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/geo/views.py" afterPath="$PROJECT_DIR$/geo/views.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/models.py" afterPath="$PROJECT_DIR$/core/models.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
</list>
<ignored path="friendfinder.iws" />
<ignored path=".idea/workspace.xml" />
......@@ -43,8 +33,8 @@
<file leaf-file-name="models.py" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/geo/models.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="360">
<caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
<state vertical-scroll-proportion="0.0" vertical-offset="15" max-vertical-offset="405">
<caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
<folding />
</state>
</provider>
......@@ -53,8 +43,8 @@
<file leaf-file-name="views.py" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/geo/views.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="300">
<caret line="13" column="0" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
<state vertical-scroll-proportion="0.0" vertical-offset="135" max-vertical-offset="435">
<caret line="22" column="0" selection-start-line="22" selection-start-column="0" selection-end-line="22" selection-end-column="0" />
<folding>
<element signature="e#0#35#0" expanded="true" />
</folding>
......@@ -62,10 +52,10 @@
</provider>
</entry>
</file>
<file leaf-file-name="urls.py" pinned="false" current="true" current-in-tab="true">
<file leaf-file-name="urls.py" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ffREST/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.24336283" vertical-offset="0" max-vertical-offset="678">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="450">
<caret line="11" column="45" selection-start-line="11" selection-start-column="45" selection-end-line="11" selection-end-column="45" />
<folding>
<element signature="e#0#51#0" expanded="true" />
......@@ -74,13 +64,23 @@
</provider>
</entry>
</file>
<file leaf-file-name="models.py" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/core/models.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.15486726" vertical-offset="0" max-vertical-offset="678">
<caret line="7" column="38" selection-start-line="7" selection-start-column="38" selection-end-line="7" selection-end-column="38" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="admin.py" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/geo/admin.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="210">
<caret line="7" column="44" selection-start-line="7" selection-start-column="44" selection-end-line="7" selection-end-column="44" />
<folding>
<element signature="e#0#32#0" expanded="true" />
<element signature="e#0#36#0" expanded="true" />
</folding>
</state>
</provider>
......@@ -103,6 +103,7 @@
<option value="$PROJECT_DIR$/geo/admin.py" />
<option value="$PROJECT_DIR$/geo/views.py" />
<option value="$PROJECT_DIR$/ffREST/urls.py" />
<option value="$PROJECT_DIR$/core/models.py" />
</list>
</option>
</component>
......@@ -118,7 +119,7 @@
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="1" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectReloadState">
......@@ -336,23 +337,23 @@
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="210">
<caret line="7" column="44" selection-start-line="7" selection-start-column="44" selection-end-line="7" selection-end-column="44" />
<folding>
<element signature="e#0#32#0" expanded="true" />
<element signature="e#0#36#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/geo/models.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="360">
<caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
<state vertical-scroll-proportion="0.0" vertical-offset="15" max-vertical-offset="405">
<caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/geo/views.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="300">
<caret line="13" column="0" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
<state vertical-scroll-proportion="0.0" vertical-offset="135" max-vertical-offset="435">
<caret line="22" column="0" selection-start-line="22" selection-start-column="0" selection-end-line="22" selection-end-column="0" />
<folding>
<element signature="e#0#35#0" expanded="true" />
</folding>
......@@ -361,7 +362,7 @@
</entry>
<entry file="file://$PROJECT_DIR$/ffREST/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.24336283" vertical-offset="0" max-vertical-offset="678">
<state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="450">
<caret line="11" column="45" selection-start-line="11" selection-start-column="45" selection-end-line="11" selection-end-column="45" />
<folding>
<element signature="e#0#51#0" expanded="true" />
......@@ -369,6 +370,14 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/core/models.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.15486726" vertical-offset="0" max-vertical-offset="678">
<caret line="7" column="38" selection-start-line="7" selection-start-column="38" selection-end-line="7" selection-end-column="38" />
<folding />
</state>
</provider>
</entry>
</component>
</project>
......@@ -5,8 +5,15 @@ from django.contrib.auth import get_user_model
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from rest_framework import serializers
from django.contrib.auth.models import User
@receiver(post_save, sender=get_user_model())
def create_auth_token(sender, instance=None, created=False, **kwargs):
if created:
Token.objects.create(user=instance)
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('id', 'username', 'email')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment