def __init__(self, jid, **kwds):
        super(Contact, self).__init__()

        # required
        if isinstance(jid, basestring):
            self.jid = JID(jid)
        elif isinstance(jid, JID):
            self.jid = jid
            self.jid.validate(raise_error=True)
        else:
            raise AttributeError("Needs valid jid either as string or JID instance")

        # optional
        self.approved = False
        self.ask = None
        self.name = None
        self.subscription = "none"
        self.groups = []

        for k, v in kwds.iteritems():
            setattr(self, k, v)