Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
campaign
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
piphone
campaign
Commits
19026697
Commit
19026697
authored
Nov 21, 2014
by
Aymeric Barantal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
name correctly foreign key
parent
9614b0b5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
122 deletions
+16
-122
campaign/campaign/migrations/0001_initial.py
campaign/campaign/migrations/0001_initial.py
+0
-89
campaign/campaign/models.py
campaign/campaign/models.py
+3
-3
campaign/organization/admin.py
campaign/organization/admin.py
+2
-1
campaign/organization/migrations/0001_initial.py
campaign/organization/migrations/0001_initial.py
+0
-27
campaign/organization/models.py
campaign/organization/models.py
+10
-2
campaign/settings.py
campaign/settings.py
+1
-0
No files found.
campaign/campaign/migrations/0001_initial.py
deleted
100644 → 0
View file @
9614b0b5
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
models
,
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'organization'
,
'0001_initial'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Argumentary'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
serialize
=
False
,
primary_key
=
True
)),
(
'lang'
,
models
.
CharField
(
max_length
=
255
)),
],
options
=
{
},
bases
=
(
models
.
Model
,),
),
migrations
.
CreateModel
(
name
=
'Campaign'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
serialize
=
False
,
primary_key
=
True
)),
(
'title'
,
models
.
CharField
(
max_length
=
255
)),
(
'description'
,
models
.
CharField
(
max_length
=
512
)),
(
'start_date'
,
models
.
DateTimeField
()),
(
'end_date'
,
models
.
DateTimeField
()),
(
'default_lang'
,
models
.
CharField
(
max_length
=
5
)),
],
options
=
{
},
bases
=
(
models
.
Model
,),
),
migrations
.
CreateModel
(
name
=
'CampaignContact'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
serialize
=
False
,
primary_key
=
True
)),
(
'weight'
,
models
.
IntegerField
(
default
=
0
)),
(
'campaign_id'
,
models
.
ForeignKey
(
to
=
'campaign.Campaign'
)),
],
options
=
{
},
bases
=
(
models
.
Model
,),
),
migrations
.
CreateModel
(
name
=
'Contact'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
serialize
=
False
,
primary_key
=
True
)),
(
'first_name'
,
models
.
CharField
(
max_length
=
64
)),
(
'last_name'
,
models
.
CharField
(
max_length
=
64
)),
(
'phone'
,
models
.
CharField
(
max_length
=
32
)),
(
'twitter'
,
models
.
CharField
(
max_length
=
64
)),
(
'mail'
,
models
.
CharField
(
max_length
=
255
)),
],
options
=
{
},
bases
=
(
models
.
Model
,),
),
migrations
.
CreateModel
(
name
=
'Group'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
serialize
=
False
,
primary_key
=
True
)),
(
'name'
,
models
.
CharField
(
max_length
=
64
)),
(
'type'
,
models
.
CharField
(
max_length
=
255
)),
(
'media'
,
models
.
CharField
(
max_length
=
255
)),
(
'contacts'
,
models
.
ManyToManyField
(
to
=
'campaign.Contact'
)),
(
'organisation_id'
,
models
.
ForeignKey
(
to
=
'organization.Organization'
)),
],
options
=
{
},
bases
=
(
models
.
Model
,),
),
migrations
.
AddField
(
model_name
=
'campaigncontact'
,
name
=
'contact_id'
,
field
=
models
.
ForeignKey
(
to
=
'campaign.Contact'
),
preserve_default
=
True
,
),
migrations
.
AddField
(
model_name
=
'argumentary'
,
name
=
'campaign_id'
,
field
=
models
.
ForeignKey
(
to
=
'campaign.Campaign'
),
preserve_default
=
True
,
),
]
campaign/campaign/models.py
View file @
19026697
...
...
@@ -29,7 +29,7 @@ class Campaign(models.Model):
class
Argumentary
(
models
.
Model
):
id
=
models
.
AutoField
(
primary_key
=
True
)
campaign
_id
=
models
.
ForeignKey
(
Campaign
)
campaign
=
models
.
ForeignKey
(
Campaign
)
lang
=
models
.
CharField
(
max_length
=
255
)
text
=
models
.
TextField
(
null
=
True
)
...
...
@@ -37,6 +37,6 @@ class Argumentary(models.Model):
class
CampaignContact
(
models
.
Model
):
"""List contact related to a campaign with a given weight"""
id
=
models
.
AutoField
(
primary_key
=
True
)
campaign
_id
=
models
.
ForeignKey
(
Campaign
)
contact
_id
=
models
.
ForeignKey
(
Contact
)
campaign
=
models
.
ForeignKey
(
Campaign
)
contact
=
models
.
ForeignKey
(
Contact
)
weight
=
models
.
IntegerField
(
default
=
0
)
campaign/organization/admin.py
View file @
19026697
from
django.contrib
import
admin
from
campaign.organization.models
import
Organization
,
Group
from
campaign.organization.models
import
Organization
,
Group
,
FeedbackCategory
admin
.
site
.
register
(
Organization
)
admin
.
site
.
register
(
Group
)
admin
.
site
.
register
(
FeedbackCategory
)
campaign/organization/migrations/0001_initial.py
deleted
100644 → 0
View file @
9614b0b5
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
models
,
migrations
from
django.conf
import
settings
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
migrations
.
swappable_dependency
(
settings
.
AUTH_USER_MODEL
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Organization'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
serialize
=
False
,
primary_key
=
True
)),
(
'name'
,
models
.
CharField
(
max_length
=
64
)),
(
'sip_key'
,
models
.
CharField
(
max_length
=
255
)),
(
'users'
,
models
.
ForeignKey
(
to
=
settings
.
AUTH_USER_MODEL
)),
],
options
=
{
},
bases
=
(
models
.
Model
,),
),
]
campaign/organization/models.py
View file @
19026697
...
...
@@ -7,7 +7,7 @@ class Organization(models.Model):
id
=
models
.
AutoField
(
primary_key
=
True
)
name
=
models
.
CharField
(
max_length
=
64
)
sip_key
=
models
.
CharField
(
max_length
=
255
)
users
=
models
.
ForeignKey
(
User
,
null
=
True
,
blank
=
True
)
users
=
models
.
ManyToManyField
(
User
,
null
=
True
,
blank
=
True
)
def
__unicode__
(
self
):
return
self
.
name
...
...
@@ -16,7 +16,7 @@ class Organization(models.Model):
class
Group
(
models
.
Model
):
"""Group model to qualify contacts"""
id
=
models
.
AutoField
(
primary_key
=
True
)
organisation
_id
=
models
.
ForeignKey
(
Organization
)
organisation
=
models
.
ForeignKey
(
Organization
)
name
=
models
.
CharField
(
max_length
=
64
)
type
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
)
media
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
)
...
...
@@ -24,3 +24,11 @@ class Group(models.Model):
def
__unicode__
(
self
):
return
self
.
name
class
FeedbackCategory
(
models
.
Model
):
id
=
models
.
AutoField
(
primary_key
=
True
)
name
=
models
.
CharField
(
max_length
=
64
)
def
__unicode__
(
self
):
return
self
.
name
campaign/settings.py
View file @
19026697
...
...
@@ -38,6 +38,7 @@ INSTALLED_APPS = (
'django.contrib.staticfiles'
,
'campaign.campaign'
,
'campaign.organization'
,
'campaign.feedback'
,
)
MIDDLEWARE_CLASSES
=
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment