Commit ec1a20ad authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

Removed lastname from contact

parent 138dad8b
......@@ -3,9 +3,8 @@
"pk": 1,
"model": "edumanage.contact",
"fields": {
"lastname": "Mousmoulas",
"email": "zmouzm@grnet.gr",
"firstname": "Zenon",
"firstname": "Zenon Mousmoulas",
"phone": "00302107474244"
}
}, {
......
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Contact.lastname'
db.delete_column('edumanage_contact', 'contact_lastname')
def backwards(self, orm):
# Adding field 'Contact.lastname'
db.add_column('edumanage_contact', 'lastname', self.gf('django.db.models.fields.CharField')(default=None, max_length=80, db_column='contact_lastname'), keep_default=False)
models = {
'contenttypes.contenttype': {
'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'edumanage.contact': {
'Meta': {'object_name': 'Contact'},
'email': ('django.db.models.fields.CharField', [], {'max_length': '80', 'db_column': "'contact_email'"}),
'firstname': ('django.db.models.fields.CharField', [], {'max_length': '80', 'db_column': "'contact_firstname'"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'phone': ('django.db.models.fields.CharField', [], {'max_length': '80', 'db_column': "'contact_phone'"})
},
'edumanage.institution': {
'Meta': {'object_name': 'Institution'},
'ertype': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '1', 'db_column': "'type'"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'realmid': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Realm']"})
},
'edumanage.institutioncontactpool': {
'Meta': {'object_name': 'InstitutionContactPool'},
'contact': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['edumanage.Contact']", 'unique': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'institution': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Institution']"})
},
'edumanage.institutiondetails': {
'Meta': {'object_name': 'InstitutionDetails'},
'address_city': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
'address_street': ('django.db.models.fields.CharField', [], {'max_length': '96'}),
'contact': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['edumanage.Contact']", 'symmetrical': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'institution': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['edumanage.Institution']", 'unique': 'True'}),
'number_id': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '6'}),
'number_user': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}),
'oper_name': ('django.db.models.fields.CharField', [], {'max_length': '24', 'null': 'True', 'blank': 'True'}),
'ts': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
'edumanage.instrealm': {
'Meta': {'object_name': 'InstRealm'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instid': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Institution']"}),
'proxyto': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['edumanage.InstServer']", 'symmetrical': 'False'}),
'realm': ('django.db.models.fields.CharField', [], {'max_length': '160'})
},
'edumanage.instrealmmon': {
'Meta': {'object_name': 'InstRealmMon'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instid': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Institution']"}),
'mon_type': ('django.db.models.fields.CharField', [], {'max_length': '8'}),
'realm': ('django.db.models.fields.CharField', [], {'max_length': '20'})
},
'edumanage.instserver': {
'Meta': {'object_name': 'InstServer'},
'acct_port': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '5', 'null': 'True', 'blank': 'True'}),
'ertype': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '1', 'db_column': "'type'"}),
'host': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instid': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Institution']"}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'null': 'True', 'blank': 'True'}),
'port': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '5', 'null': 'True', 'blank': 'True'}),
'proto': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
'retry': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}),
'secret': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
'status_server': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'timeout': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}),
'ts': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
'edumanage.monlocaleapoldata': {
'Meta': {'object_name': 'MonLocalEAPOLData'},
'cert': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'eap_method': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
'exp_response': ('django.db.models.fields.CharField', [], {'max_length': '6'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instrealmmonid': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.InstRealmMon']"}),
'passwp': ('django.db.models.fields.CharField', [], {'max_length': '24', 'db_column': "'pass'"}),
'phase2': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
'username': ('django.db.models.fields.CharField', [], {'max_length': '24'})
},
'edumanage.monproxybackclient': {
'Meta': {'object_name': 'MonProxybackClient'},
'host': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'instrealmmonid': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.InstRealmMon']"}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'proto': ('django.db.models.fields.CharField', [], {'max_length': '12'}),
'secret': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
'status_server': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'ts': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
'edumanage.name_i18n': {
'Meta': {'object_name': 'Name_i18n'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lang': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'})
},
'edumanage.realm': {
'Meta': {'object_name': 'Realm'},
'address_city': ('django.db.models.fields.CharField', [], {'max_length': '24'}),
'address_street': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
'contact': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['edumanage.Contact']", 'symmetrical': 'False'}),
'country': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'stype': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'max_length': '1'}),
'ts': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
},
'edumanage.realmdata': {
'Meta': {'object_name': 'RealmData'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'number_IdP': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '5'}),
'number_IdPSP': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '5'}),
'number_SP': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '5'}),
'number_id': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '9'}),
'number_inst': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '5'}),
'number_user': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '9'}),
'realmid': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['edumanage.Realm']", 'unique': 'True'}),
'ts': ('django.db.models.fields.DateTimeField', [], {})
},
'edumanage.serviceloc': {
'AP_no': ('django.db.models.fields.PositiveIntegerField', [], {'max_length': '3'}),
'IPv6': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'Meta': {'object_name': 'ServiceLoc'},
'NAT': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'SSID': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
'address_city': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
'address_street': ('django.db.models.fields.CharField', [], {'max_length': '96'}),
'contact': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['edumanage.Contact']", 'null': 'True', 'blank': 'True'}),
'enc_level': ('edumanage.models.MultiSelectField', [], {'max_length': '64'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'institutionid': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Institution']"}),
'latitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '6'}),
'longitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '8', 'decimal_places': '6'}),
'port_restrict': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'transp_proxy': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'ts': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'wired': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'})
},
'edumanage.url_i18n': {
'Meta': {'object_name': 'URL_i18n'},
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'lang': ('django.db.models.fields.CharField', [], {'max_length': '5'}),
'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
'url': ('django.db.models.fields.CharField', [], {'max_length': '180', 'db_column': "'URL'"}),
'urltype': ('django.db.models.fields.CharField', [], {'max_length': '10', 'db_column': "'type'"})
}
}
complete_apps = ['edumanage']
......@@ -141,12 +141,11 @@ class Contact(models.Model):
'''
firstname = models.CharField(max_length=80, db_column='contact_firstname')
lastname = models.CharField(max_length=80, db_column='contact_lastname')
email = models.CharField(max_length=80, db_column='contact_email')
phone = models.CharField(max_length=80, db_column='contact_phone')
def __unicode__(self):
return '%s %s <%s> (%s)' % (self.firstname, self.lastname, self.email, self.phone)
return '%s %s <%s> (%s)' % (self.firstname, self.email, self.phone)
class InstitutionContactPool(models.Model):
......
......@@ -969,7 +969,7 @@ def instxml(request):
instContact = ET.SubElement(instElement, "contact")
instContactName = ET.SubElement(instContact, "name")
instContactName.text = "%s %s" %(contact.firstname, contact.lastname)
instContactName.text = "%s" %(contact.firstname)
instContactEmail = ET.SubElement(instContact, "email")
instContactEmail.text = contact.email
......@@ -1010,7 +1010,7 @@ def instxml(request):
instLocContact = ET.SubElement(instLocation, "contact")
instLocContactName = ET.SubElement(instLocContact, "name")
instLocContactName.text = "%s %s" %(contact.firstname, contact.lastname)
instLocContactName.text = "%s" %(contact.firstname)
instLocContactEmail = ET.SubElement(instLocContact, "email")
instLocContactEmail.text = contact.email
......@@ -1085,7 +1085,7 @@ def realmxml(request):
realmContact = ET.SubElement(realmElement, "contact")
realmContactName = ET.SubElement(realmContact, "name")
realmContactName.text = "%s %s" %(contact.firstname, contact.lastname)
realmContactName.text = "%s" %(contact.firstname)
realmContactEmail = ET.SubElement(realmContact, "email")
realmContactEmail.text = contact.email
......
......@@ -10,14 +10,6 @@
{% endif %} <span class="help-block"> {{ form.firstname.help_text }}</span>
</div>
</div>
<div class="control-group {% if form.lastname.errors %} error {% endif %}">
<label class="control-label" for="id_lastname"><b>{% trans "Last name" %}</b></label>
<div class="controls">
{{ form.lastname }}
{% if form.lastname.errors %} <span class="help-inline"> {{ form.lastname.errors|join:", " }} </span>
{% endif %} <span class="help-block"> {{ form.lastname.help_text }}</span>
</div>
</div>
<div class="control-group {% if form.email.errors %} error {% endif %}">
<label class="control-label" for="id_email"><b>{% trans "Email" %}</b></label>
<div class="controls">
......
......@@ -114,10 +114,10 @@ $("#delcontactSubmit").click(function(){
<tbody>
{% for contact in contacts %}
<tr class="GradeC">
<td>{{contact.firstname}} {{contact.lastname}}</td>
<td>{{contact.firstname}}</td>
<td>{{contact.email}}</td>
<td>{{contact.phone}}</td>
<td style="text-align: center;"><a href="{% url edit-contacts contact.pk %}" class="btn btn-small">{% trans "edit" %}</a> <a href="#" id="del_contact_{{contact.pk}}" data-contactname="{{contact.firstname}} {{contact.lastname}}" class="btn btn-small btn-warning">{% trans "delete" %}</a></td>
<td style="text-align: center;"><a href="{% url edit-contacts contact.pk %}" class="btn btn-small">{% trans "edit" %}</a> <a href="#" id="del_contact_{{contact.pk}}" data-contactname="{{contact.firstname}}" class="btn btn-small btn-warning">{% trans "delete" %}</a></td>
</tr>
{% endfor %}
</tbody>
......
......@@ -3,7 +3,7 @@
{% block crumbs %}
<li><a href="{% url manage %}">{% trans "Home" %}</a><span class="divider">/</span></li>
<li><a href="{% url contacts %}">{% trans "Contacts" %}</a><span class="divider">/</span></li>
<li class="active">{% if edit %}{{form.instance.firstname}} {{form.instance.lastname}} ({% trans "edit" %}){% else %}{% trans "Add Contact" %}{% endif %}</li>
<li class="active">{% if edit %}{{form.instance.firstname}} ({% trans "edit" %}){% else %}{% trans "Add Contact" %}{% endif %}</li>
{% endblock %}
{% block extrahead %}
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
......@@ -17,7 +17,7 @@
{% block homeactive %}{% endblock %}
{% block contactsactive %}class="active"{% endblock %}
{% block subcontent %} <h4>{% if edit %}{{form.instance.firstname}} {{form.instance.lastname}} ({% trans "edit" %}){% else %}{% trans "Add Contact" %}{% endif %}</h4>
{% block subcontent %} <h4>{% if edit %}{{form.instance.firstname}} ({% trans "edit" %}){% else %}{% trans "Add Contact" %}{% endif %}</h4>
<hr>
<form method="POST" class="form-horizontal">
{% csrf_token %}
......@@ -37,14 +37,6 @@
{% endif %} <span class="help-block"> {{ form.firstname.help_text }}</span>
</div>
</div>
<div class="control-group {% if form.lastname.errors %} error {% endif %}">
<label class="control-label" for="id_lastname"><b>{% trans "Last name" %}</b></label>
<div class="controls">
{{ form.lastname }}
{% if form.lastname.errors %} <span class="help-inline"> {{ form.lastname.errors|join:", " }} </span>
{% endif %} <span class="help-block"> {{ form.lastname.help_text }}</span>
</div>
</div>
<div class="control-group {% if form.email.errors %} error {% endif %}">
<label class="control-label" for="id_email"><b>{% trans "Email" %}</b></label>
<div class="controls">
......
......@@ -52,7 +52,7 @@
<label class="control-label" for="id_contact">{% trans "Contacts" %}</label>
<div class="controls">
{% for contact in institution.institutiondetails.contact.all %}
{{contact.firstname}} {{contact.lastname}} (<a href="mailto:{{contact.email}}">{{contact.email}}</a> - tel:{{contact.phone}}){% if not forloop.last %}<br>{% endif %}
{{contact.firstname}} (<a href="mailto:{{contact.email}}">{{contact.email}}</a> - tel:{{contact.phone}}){% if not forloop.last %}<br>{% endif %}
{% endfor %}
</div>
</div>
......
......@@ -137,7 +137,7 @@
<label class="control-label" for="id_contact">{% trans "Contacts" %}</label>
<div class="controls">
{% for contact in service.contact.all %}
{{contact.firstname}} {{contact.lastname}} (<a href="mailto:{{contact.email}}">{{contact.email}}</a> - tel:{{contact.phone}}){% if not forloop.last %}<br>{% endif %}
{{contact.firstname}} (<a href="mailto:{{contact.email}}">{{contact.email}}</a> - tel:{{contact.phone}}){% if not forloop.last %}<br>{% endif %}
{% endfor %}
</div>
</div>
......
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