table is
cities with populations and the foreign key of Countries table.
Then having chosen Auckland a city in New Zealand I want to display
Country
City
Population
In a template.
I have done this in Php, Javascript and Mysql already.
Cheers Dave
--
Dave Merrick
TutorInvercargill
http
/
but Domain4less can't use Dynamic IP address so the two are related sorry.
On Sat, May 9, 2020 at 10:14 AM Kasper Laudrup
wrote:
> Hi David,
>
> On 08/05/2020 23.18, David Merrick wrote:
> > Hi, I am interested in what web servers can be used for Django Web Apps
> > and whether th
Hi, I am interested in what web servers can be used for Django Web Apps and
whether the Domain Name Servers are Static or Dynamic. Static Domain Name
Servers (DNS) the IP Address doesn't change and Dynamic (DNS) IP Address
does change.
--
You received this message because you are subscribed
I am asking about web hosting and appropriate Domain Name Servers
On Fri, May 8, 2020 at 9:18 PM David Merrick wrote:
> Same Domain Name Servers can only handle
> static DNS server
> https://ticket.cdmon.com/en/support/solutions/articles/706124-what-is-a-static-dns-server-
"and what
> domain names / types" ?
>
> On Friday, May 8, 2020 at 8:33:43 AM UTC+2, David Merrick wrote:
>>
>> Sounds like a very good idea.
>> I have one immediate question. What web servers can host Django and what
>> Domain Names / types?
>> I was usi
a3d-45ea-b43d-6d22b54469b2%40googlegroups.com?utm_medium=email_source=footer>
> .
>
--
Dave Merrick
TutorInvercargill
http://tutorinvercargill.co.nz
Daves Web Designs
Website http://www.daveswebdesigns.co.nz
Email merrick...@gmail.com
Ph 03 216 2053
Cell 027 3089 169
--
You receiv
t default for cookies (SameSite=Lax)?
>
> Am Montag, 20. April 2020 14:43:10 UTC+2 schrieb David Merrick:
>>
>> if you want cross site forgery requests get rid off it
>>
>> On Mon, Apr 20, 2020 at 10:45 PM Andréas Kühne
>> wrote:
>>
>>> Why is it
o view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK4qSCeO0bkxsGYFc7t-V7%2BZnr965gYAG0oALB0ELtoJjojedg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK4qSCeO0bkxsGYFc7t-V7%2BZnr965gYAG0oALB0ELtoJjojedg%40mail.gmail.com?utm_mediu
')
def __init__(self, *args, **kw):
self.request = kw.pop('request')
super(SomeForm, self).__init__(*args, **kw)
On Apr 7, 10:19 am, Merrick <merr...@gmail.com> wrote:
> I appreciate all of the help, I was actually showing both Daniel and
> Raj that their suggestio
a suggestion aside from that?
Thanks.
On Apr 7, 10:07 am, Tom Evans <tevans...@googlemail.com> wrote:
> On Wed, Apr 7, 2010 at 5:30 PM, Merrick <merr...@gmail.com> wrote:
> > Thank you.
>
> > I'll be more specific, here is what I have:
>
> > views.py
> >
wrote:
> On Apr 7, 8:05 am, Merrick <merr...@gmail.com> wrote:
>
> > How should I go about adding a field to a model form
> > when the field is not part of the model?
>
> Define a Custom ModelForm by specifying model in Meta and declare the
> required addnl field there.
I added a checkbox form field to my template, and I even tried to add
it in my forms.py and then in my views.py I check for it like so:
if form.cleaned_data['checkbox_field']:
code to send email...
But when I submit the form I get a KeyError. How should I go about
adding a field to a model
I wanted to give users who are authenticated the ability to upload
files, that's the easy part that I can handle.
What I cannot figure out is how to restrict the viewing/downloading of
files.
Links, tips, code are appreciated.
Thanks
--
You received this message because you are subscribed to
ent_list': comment_list})
>
> in "view_post.html" you'll be able to choose indentation by second
> item of the tuple, which is in the comment_list variable. I'm sorry if
> there are errors, I didn't validate that code, this is just an idea.
>
> On 2 ÍÁÒ, 09:53, Merrick <mer
I have a comments model that is setup to do threaded replies. I am
having trouble figuring out how to display the comments in a threaded
manner, i.e. tree.
My model looks like this:
class Comment(models.Model):
post = models.ForeignKey(Post, null=True, blank=True)
user =
Got it thanks, I'll try it out.
On Sep 15, 11:47 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Sep 16, 6:45 am, Merrick <merr...@gmail.com> wrote:
>
>
>
> > I have a project that I am thinking of breaking up into 2 sites/
> > projects. The goal is to
I have a project that I am thinking of breaking up into 2 sites/
projects. The goal is to be able to make changes to one site/project
without affecting the other one. Here is an example of what each would
do:
mydomain.com
-
- displays the brochure website (sales copy on the
yourmodel (models.Model):
domain = models.URLField(...)
@property
def strippeddomain (self):
return stripdomain(self.domain)
Then from the shell this works:
>>> url = yourmodel.objects.get(id=1)
>>> url.strippeddomain
u'yourdomain.com'
On Aug 24, 3:37
Looks like we were writing at the same time. I also was not aware you
could call a model method in a template without the parenthesis,
that's where I was getting hung up.
Again thank you.
On Aug 24, 3:54 pm, Javier Guerra <jav...@guerrag.com> wrote:
> On Mon, Aug 24, 2009 at 5:37 PM
url.stripdomain() returns:
yourdomain.com
Do you know if there is a way to have url.domain return what
stripdomain() did above? Otherwise I'll use a template filter and move
on.
Merrick
On Aug 24, 12:20 pm, Javier Guerra <jav...@guerrag.com> wrote:
> On Mon, Aug 24, 2009 at 1:42 PM
missing something?
On Aug 24, 11:05 am, Javier Guerra <jav...@guerrag.com> wrote:
> On Mon, Aug 24, 2009 at 1:01 PM, Merrick<merr...@gmail.com> wrote:
> > I know how to parse the URL but am drawing a blank on how to
> > accomplish this at the model level.
>
> add a f
I have this in models.py:
domain = models.URLField(...)
Let's say one row in the table has this for domain:
'http://www.google.com'
When the domain field is looked up, I would like to return:
www.google.com
I know how to parse the URL but am drawing a blank on how to
accomplish this at the
I am using S3Storage with an imagefield successfully. It sounds like
you have not specified the storage engine and keys etc... in
settings.py as creecode pointed out.
I recall testing that the directory will be created on the fly if it
does not exist.
On Jan 19, 12:40 pm, creecode
of
new_profile = pform.save(commit=False)
new_profile.picture.save(filename, thumbnail_content)
Merrick
On Dec 22, 1:10 pm, brianmac44 <anon1...@gmail.com> wrote:
> With my code, what are you using as "content"?
>
> I'm using: form.cleaned_data['source'].read()
>
>
gt;
> Hope this helps.
>
> -Brian
>
> On Dec 22, 4:41 am, Merrick <merr...@gmail.com> wrote:
>
> > Thank you I tried that and I still get the same error.
>
> > I spent a little more time looking at PIL / Image.py and cleaning up
> > the code. From what
Thank you I tried that and I still get the same error.
I spent a little more time looking at PIL / Image.py and cleaning up
the code. From what I can tell the Image.open method is having trouble
with what I am passing to it.
def resize_image(file, size=(50, 50)):
from PIL import Image
I setup S3Storage as my default storage and can successfully upload
images to S3 without overriding save on my profile_update below. Right
now, when I submit a form with an image I get the original image
uploaded in my S3 bucket not a thumbnail and an IO Error - "cannot
identify image file" -
But of course! Thank you.
On Nov 17, 8:25 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Mon, Nov 17, 2008 at 9:06 PM, Merrick <[EMAIL PROTECTED]> wrote:
>
> > I cannot figure out how to update a foreign key to a null value.
> > Thanks
I cannot figure out how to update a foreign key to a null value.
Thanks.
models.py
group = models.ForeignKey(group, null=True, blank=True)
>>> from redirect.models import *
>>> Links = Link.objects.filter(group = 6)
>>> Links.update(group = NULL)
Traceback (most recent call last):
> On Sun, 16 Nov 2008 23:21:05 -0800 (PST), Merrick <[EMAIL PROTECTED]>
> > declared:
> >> I have two models, links and groups. A Link has an optional foreign
> >> key Group.
>
> >> When I delete a Group, Django by default deletes all Links that
> &
I have two models, links and groups. A Link has an optional foreign
key Group.
When I delete a Group, Django by default deletes all Links that
referenced the Group that is being deleted.
How do I avoid the default behavior that does a cascade delete. Of
course I could use the cursor but would
(request=request)
The error I get makes it clear I don't have access to request within
class Meta:
NameError at /
name 'self' is not defined
Thanks,
Merrick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"D
How can I access request.user in a clean method of a ModelForm?
I have the following code in forms.py:
===
#profle email form
class UserEmailForm(ModelForm):
class Meta:
model = User
fields = ['email',]
def clean_email(self):
email_submitted =
I have the code below:
===
class UserEmailForm(ModelForm):
class Meta:
model = User
fields = ['email',]
def clean_email(self):
email_submitted = self.cleaned_data.get('email')
email_exists =
I think it might be overkill to use GeoDjango, anyone else know of a
module I can use for this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Thank you Graham, I was going crazy trying to figure this out.
Thankfully I control my hosting environment top to bottom (colocation)
so I will try using REQUEST_URI I will use it.
On Oct 8, 3:00 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Oct 8, 5:57 pm, Merrick <[EMA
Could this problem be in the wsgi.py handler in django? If not I
suppose I need to look at mod_wsgi and quit asking here :)
On Oct 7, 4:05 pm, Merrick <[EMAIL PROTECTED]> wrote:
> I need urls that contain other urls within them i.e.
>
> http://mydomain.com/find/http%3A%2F%2Fwww.
n urls.py up
until this point because it is not related to this problem from what I
can tell, but in case you are wondering I was trying to capture the
url after find/ - my regex looks like this r'^find/(?P(.*))$'
Thanks for looking at this,
Merrick
--~--~-~--~~~---~--~---
I think this is related to WSGI.
On Oct 6, 7:17 pm, Merrick <[EMAIL PROTECTED]> wrote:
> That is the approach I took and how I resolved the original problem
> with the 404. It led me to find that "AllowEncodedSlashes On" in
> Apache is needed for encoded slashes to b
Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2008-10-06 at 16:10 -0700, Merrick wrote:
> > keith, thanks for trying.
>
> > %2f is the encoded value of /, but urls contain other characters as
> > well not just alphanumeric.
>
> I think you're debugging the wrong piec
%2Fwww.wired.com%2F
I am able to capture the URL, but with only one slash. I pass it to my
ModelForm and it prints in my template as:
http:/www.wired.com/
Note the lack of double forward slashes after the colon.
On Oct 6, 4:10 pm, Merrick <[EMAIL PROTECTED]> wrote:
> keith, thanks for trying
, i think you could add the % to the regex (i'm hardly a
> regex master):
>
> r'^find/(?P[%-\w]+)$
>
> keith
>
> On Mon, Oct 6, 2008 at 7:05 PM, Merrick <[EMAIL PROTECTED]> wrote:
>
> > I have narrowed down the problem to %2F in my url, anyone?
>
> >
I have narrowed down the problem to %2F in my url, anyone?
On Oct 6, 2:55 pm, Merrick <[EMAIL PROTECTED]> wrote:
> \w will only match alphanumeric characters, I need to match anything
> and will let my modelform verify that it is indeed a URL.
>
> On Oct 6, 2:43 pm, Merrick
if APPEND_SLASH = True. the regex should look like:
>
> r'^find/(?P[-\w]+)/$'
>
> should be urls.py too, not views.py.
>
> keith
>
> On Mon, Oct 6, 2008 at 1:17 PM, Merrick <[EMAIL PROTECTED]> wrote:
>
> > I am trying to figure out how to match / capture
\w will only match alphanumeric characters, I need to match anything
and will let my modelform verify that it is indeed a URL.
On Oct 6, 2:43 pm, Merrick <[EMAIL PROTECTED]> wrote:
> Thank you, I meant urls.py. APPEND_SLASH = False so I omitted the
> trailing slash from the regex
I am trying to figure out how to match / capture a URL.
views.py
===
urlpatterns = patterns('',
url(r'^find/(?P(.*)$',
view = 'myapp.views.find',
name = 'find'
),
when I enter in this address:
mydomain.com/find/www.wired.com
my view / template are executed, but if
:49 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On Wednesday 01 October 2008 01:35:55 am Merrick wrote:
>
> > All is not lost if a user enters an invalid code I still want to do
> > something with just the url, but I cannot get
> > form.cleaned_data.get('url')
My ModelForm has two input fields url and code, and I raise a
ValidationError if the code contains anything other than letters,
numbers and dashes. My logic looks something like this:
if form.is_valid():
...
return render_to_response('new.html', {'code': new.code})
if ValueError:
if
that the L stood for long, anyhow this works:
id = int(row[0]
encode_id(id)
On Sep 30, 7:15 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-09-30 at 15:08 -0700, Merrick wrote:
> > If I run the following query on psql:
>
> > SELECT nextv
If I run the following query on psql:
SELECT nextval('redirect_link_id_seq');
it returns an integer, say 5
when I do the following with the django shell I get a different
result:
>>> def get_next_id():
... cursor = connection.cursor()
... cursor.execute("SELECT
I have a function in my model where I need the next sequence id from
postgresql so i can create an encoded value based off it. Any ideas on
how to do this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
I have a form on the homepage of mydomain.com that instructs people to
submit their email address and we'll notify them when we launch our
service. For those visitors that submit the form, I want to store the
referer. I am able to print out the HTTP_REFERER on the same template
as the form but I
= 'photo_detail',
),
On Apr 24, 11:43 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Thu, Apr 24, 2008 at 12:21 PM, Merrick <[EMAIL PROTECTED]> wrote:
>
> > Thank you, I updated get_absolute_url to take into consideration the
> > fact that I was erroneousl
er' object has no attribute 'place'
On Apr 24, 8:59 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Thu, 2008-04-24 at 08:55 -0700, Merrick wrote:
>
> [...]
>
> > ***Shell output
>
> > >>> from photologue.models import *
> > >>>
nnick <[EMAIL PROTECTED]>
wrote:
> On Thu, 2008-04-24 at 08:55 -0700, Merrick wrote:
>
> [...]
>
> > ***Shell output
>
> > >>> from photologue.models import *
> > >>> photo = Photo.objects.get(slug='golf-course-3')
> > >>> p
I am still learning Django, and appreciate all of the help I have
received. I spent a few hours on this and just cannot figure out how
to pull off the get_absolute_url() function the way I describe it
below for the Photo class. I want to use the slugs for related models
and step through multiple
Thank you, I had various as errors as you pointed out and as soon as I
implemented your suggestions and reset the database it all works now.
On Apr 20, 8:43 am, Peter Rowell <[EMAIL PROTECTED]> wrote:
> > featured_place = models.ForeignKey(Place, null=true, blank=true)
>
> 1. By any chance
Oops my featured_place actually reads:
featured_place = models.ForeignKey(Place, null=true, blank=true)
On Apr 19, 9:57 pm, Merrick <[EMAIL PROTECTED]> wrote:
> I updated the City model:
>
> class City(models.Model):
> state = models.ForeignKey(State)
&g
' is not defined
sorry for all the help requests here.
On Apr 19, 9:41 pm, Merrick <[EMAIL PROTECTED]> wrote:
> Thank you, I originally had featured_place as a foreign key and ran
> into a problem:
>
> null value in column "featured_id" violates not-null constrain
Thank you, I originally had featured_place as a foreign key and ran
into a problem:
null value in column "featured_id" violates not-null constraint
That is because before there is a place there has to be a city.
On Apr 19, 9:37 pm, Doug B <[EMAIL PROTECTED]> wrote:
> > What is the best
I am using the admin to do all of my data input.
I have the following models:
class City(models.Model):
city = models.CharField(max_length=100, unique=True)
class Place(models.Model):
city = models.ForeignKey(City)
title = models.CharField(max_length=255)
is_featured =
, 2008-04-18 at 17:26 -0700, Merrick wrote:
> > I get the same problem as described here:
>
> > #6523
> >http://code.djangoproject.com/ticket/6523
>
> > There is a diff file which says it fixes the problem, how should I
> > proceed? If implement the diff,
I get the same problem as described here:
#6523
http://code.djangoproject.com/ticket/6523
There is a diff file which says it fixes the problem, how should I
proceed? If implement the diff, anyone care to tell me how please.
--~--~-~--~~~---~--~~
You received this
he id's of the SiteSections as the key and the url
> that I'm using to prepopulate text box (hence the reason this is a django
> template file and not a plain javascript file).
>
> Overall it's pretty close to what you are wanting to do though.
>
> Hope that helps,
> --James
Hi James,
thank you for responding, can you point me in the right direction with
the javascript.
--Merrick
On Apr 17, 1:25 pm, "James Punteney" <[EMAIL PROTECTED]> wrote:
> I ran into this issue the other day wanting to use a foreign key value to
> prepopulate a slugf
is not
compatible with new-forms admin thus local flavor is also not an
option. Thanks. -Merrick
class State(models.Model):
state = models.CharField(max_length=100, unique=True)
class Admin:
pass
def __str__(self):
return self.state
class Meta:
ordering = ['state
66 matches
Mail list logo