Permalink
Browse files

Project's first steps

Defined basic models: UserProfile, Listing, Category
Registered models in admin's site
GeoDjango integration
Created home page draft design
Created some fixures
$
  • Loading branch information...
1 parent 056c62e commit 8295a14f755a6ae118eae8cd9b68efbafade9a5f @lalstef lalstef committed May 24, 2012
@@ -0,0 +1,3 @@
+#Thu May 24 12:59:06 EEST 2012
+eclipse.preferences.version=1
+encoding//listing/fixtures/initial_data.json=utf-8
View
@@ -1,5 +1,13 @@
-from .models import UserProfile
from django.contrib import admin
+from django.contrib.gis import admin as geoadmin
+from django.conf.__init__ import settings
+
+from accounts.models import UserProfile
-admin.site.register(UserProfile)
+class UserProfileAdmin(geoadmin.OSMGeoAdmin):
+ default_lon = settings.BERLIN_CENTER_LONGTITUDE
+ default_lat = settings.BERLIN_CENTER_LATITUDE
+ default_zoom = 11
+
+admin.site.register(UserProfile, UserProfileAdmin)
@@ -0,0 +1 @@
+[{"pk": 1, "model": "accounts.userprofile", "fields": {"city": "Berlin", "first_name": "Ahmad", "last_name": "Moalla", "country": "Germany", "mobile_number": "445688124", "zipcode": "1000", "location": "POINT (13.4095001202098469 52.5366906925501382)", "address": "Berlin main strasse", "birth_date": "1984-06-08", "email": "a7madm3alla@gmail.com"}}]
View
@@ -1,29 +1,30 @@
from django.db import models
+from django.contrib.gis.db import models as geomodels
from django.contrib.auth.models import User
+from django.conf.__init__ import settings
class UserProfile(models.Model):
+ ''' User profile
+ Represents a user that has account in the system
'''
- DELETE THIS COMMENT WHEN YOU START
- a user profile will have:
- first name
- last name
- email
- city
- country
- zipcode
- address
- data of birth
- mobile number
- location (will be used later for google maps (what fields are necessary for that?)
-
- listings one to many relation
-
- '''
class Meta:
- verbose_name = 'user_profile'
- verbose_name_plural = 'user_profiles'
+ verbose_name = 'user profile'
+ verbose_name_plural = 'user profiles'
+ first_name = models.CharField(max_length=255, null=False, blank=False, help_text="First name")
+ last_name = models.CharField(max_length=255, null=False, blank=False, help_text="Last name")
+ email = models.EmailField(max_length=255, null=False, blank=False, help_text="Email")
+ country = models.CharField(max_length=255, null=False, blank=False, help_text="Country")
+ city = models.CharField(max_length=255, null=False, blank=False, help_text="City")
+ zipcode = models.CharField(max_length=20, null=False, blank=False, verbose_name="Zip code", help_text="Zip code")
+ address = models.CharField(max_length=1024, null=False, blank=False, help_text="Address")
+ birth_date = models.DateField(help_text="Birth date")
+ mobile_number = models.CharField(max_length=30, help_text="Mobile number")
+ location = geomodels.PointField(srid=settings.WSG84, help_text="Location")
+
+ objects = geomodels.GeoManager()
+
def __unicode__(self):
- return self.title
+ return "%s %s" % (self.first_name, self.last_name)
View
@@ -13,8 +13,8 @@
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '/home/ahmad/geogeld/geogeld/geogeld/sqlite.db', # Or path to database file if using sqlite3.
- 'USER': '', # Not used with sqlite3.
- 'PASSWORD': '', # Not used with sqlite3.
+ 'USER': 'geogeld', # Not used with sqlite3.
+ 'PASSWORD': 'geogeld', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
@@ -116,6 +116,10 @@
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
+
+ 'django.contrib.gis',
+
+ 'geogeld',
'accounts',
'listing',
)
@@ -148,3 +152,16 @@
},
}
}
+
+
+WSG84 = 4326 # Spatial reference system code
+
+# Used in admin's site to define the initial positioning of the map
+BERLIN_CENTER_LONGTITUDE = 1491592.16975
+BERLIN_CENTER_LATITUDE = 6894161.32819
+
+try:
+ from local_settings import *
+except ImportError:
+ print("local_settings couldn't be imported. Maybe it causes ImportError or some other error")
+
@@ -0,0 +1,195 @@
+@CHARSET "UTF-8";
+
+a, a:visited {
+ text-decoration: none;
+ color: black;
+}
+
+body {
+ background-color: #ffffff;
+ font-family: "Sans serif";
+ font-size: 12pt;
+}
+
+.clearfix:after {
+ content: ".";
+ visibility: hidden;
+ display: block;
+ height: 0;
+ clear: both;
+}
+
+#container {
+ width: 100%;
+}
+
+#header {
+ width: 98%;
+ padding: 1%;
+ border: 1px solid gray;
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ margin-bottom: 1%;
+
+}
+
+
+#content {
+ width: 98%;
+ padding: 1%;
+ border: 1px solid gray;
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ margin-bottom: 1%;
+}
+
+#footer {
+ width: 98%;
+ padding: 1%;
+ border: 1px solid gray;
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ text-align: center;
+
+ font-size: 14pt;
+ font-weight: bold;
+ color: gray;
+ background-color: #cccccc;
+
+}
+
+#left-column {
+ width: 70%;
+ float: left;
+
+}
+
+#right-column {
+ width: 25%;
+ float: right;
+
+}
+
+#header-buttons {
+ width: 100%;
+ text-align: right;
+
+}
+
+#header-buttons a{
+ color: white;
+ background-color: gray;
+ border: 2px solid gray;
+ border-style: outset;
+ border-radius: 7px;
+ -webkit-border-radius: 7px;
+ -moz-border-radius: 7px;
+ padding: 4px;
+}
+
+#login-button {
+}
+
+#explore-button {
+}
+
+
+#ad-banner {
+ height: 200px;
+ background: white;
+ border: 1px solid gray;
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ padding: 2%;
+ margin-bottom: 2%;
+
+ text-align: center;
+
+
+}
+
+#job-listings {
+ background: white;
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ margin-bottom: 2%;
+
+}
+
+.job-listing {
+ border: 1px solid gray;
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+
+ margin-bottom: 2%;
+ padding: 2%;
+}
+
+.job-title {
+ color: #90aa08;
+ font-size: 12pt;
+ font-weight: bold;
+ text-align: center;
+ margin-bottom: 1%;
+}
+
+.job-details {
+ color: gray;
+ text-align: center;
+}
+
+.job-details a {
+ color: gray;
+ font-size: 9pt;
+ float: right;
+}
+
+#job-posting-box {
+}
+
+#quick-posting-form {
+ color: white;
+ font-weight: bold;
+ font-size: 11pt;
+ font-family: "Sans serif";
+ background: #315f83;
+ border: 1px solid gray;
+ border-radius: 7px;
+ -webkit-border-radius: 7px;
+ -moz-border-radius: 7px;
+ padding: 4%;
+}
+
+.form-element {
+ width: 98%;
+ color: #aaaaaa;
+
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-style: outset;
+
+ padding: 1%;
+ margin-bottom: 2%;
+}
+
+#continue-button {
+ color: white;
+ background-color: #90aa08;
+ border-radius: 9px;
+ -webkit-border-radius: 9px;
+ -moz-border-radius: 9px;
+
+ width: 40%;
+
+ font-size: 13pt;
+ font-weight: bold;
+ padding-left: 5%;
+ padding-right: 5%;
+}
@@ -7,7 +7,7 @@
Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
- <title>base</title>
+ <title>GeoGeld</title>
<meta name="description" content="" />
<meta name="author" content="ahmad" />
@@ -16,21 +16,30 @@
<!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
<link rel="shortcut icon" href="{{ STATIC_URL }}/favicon.ico" />
<link rel="apple-touch-icon" href="{{ STATIC_URL }}/apple-touch-icon.png" />
- <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/style.css">
+ <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}geogeld/css/style.css">
+ {% block extra_css %}
+ {% endblock extra_css %}
+
+ {% block extra_js %}
+ {% endblock extra_js %}
</head>
<body>
- <div>
- <header>
- <h1>base</h1>
+ <div id="container">
+ <header id="header">
+ <h1>GeoGeld</h1>
+ {% block header-extra %}
+
+ {% endblock header-extra %}
</header>
+ <div id="content">
+ {% block content %}
+
+ {% endblock content %}
+ </div>
- {% block content %}
-
- {% endblock content %}
-
- <footer>
+ <footer id="footer">
<p>
&copy; Copyright by GeoGeld
</p>
Oops, something went wrong.

0 comments on commit 8295a14

Please sign in to comment.