(self, value)
| 206 | super().__init__(**kwargs) |
| 207 | |
| 208 | def validate(self, value): |
| 209 | # Check first if the scheme is valid |
| 210 | scheme = value.split("://")[0].lower() |
| 211 | if scheme not in self.schemes: |
| 212 | self.error(f"Invalid scheme {scheme} in URL: {value}") |
| 213 | |
| 214 | # Then check full URL |
| 215 | if not self.url_regex.match(value): |
| 216 | self.error(f"Invalid URL: {value}") |
| 217 | |
| 218 | |
| 219 | class EmailField(StringField): |